Accessing Translets in a JSP Page

Hi,
I have a Translet[already compiled XSL file] named "pr.class" and I have a XML file named "pr.xml".
I want to transform the pr.xml to a HTML format using pr.class in a JSP page.But I am getting some errors.My code goes like this,
xml file="d:/translets/pr.xml"
class file="d:/translets/pr.class"
<%@ page
import="javax.xml.parsers.*,
org.w3c.dom.*,
javax.xml.transform.*,
javax.xml.transform.stream.*,
java.io.*,
java.io.OutputStreamWriter,
javax.xml.transform.Transformer,
javax.xml.transform.TransformerFactory,
javax.xml.transform.stream.StreamResult,
javax.xml.transform.stream.StreamSource,
javax.xml.transform.Templates;" %>
<% System.setProperty("javax.xml.transform.TransformerFactory","org.apache.xalan.xsltc.trax.TransformerFactoryImpl");
TransformerFactory tFactory = TransformerFactory.newInstance();%>
try {
StreamSource xsl = new StreamSource(new FileInputStream("D:/translets/pr.class"));
StreamSource xml = new StreamSource(new FileInputStream( "D:/translets/pr.xml"));
StreamResult htm = new StreamResult(new FileOutputStream( "D:/birds.htm"));
Transformer transformer =tFactory.newTransformer(xsl);
transformer.transform(xml,htm);}
catch(Exception e){out.println("Compilation problem");}
%>
My catch block is getting executed and giving the output as "Compilation problem".
Give me a solution.Very Urgent!!.

You are missing <% before try :-
  <%@ page
import="javax.xml.parsers.*,
org.w3c.dom.*,
javax.xml.transform.*,
javax.xml.transform.stream.*,
java.io.*,
java.io.OutputStreamWriter,
javax.xml.transform.Transformer,
javax.xml.transform.TransformerFactory,
javax.xml.transform.stream.StreamResult,
javax.xml.transform.stream.StreamSource,
javax.xml.transform.Templates;" %>
<% System.setProperty("javax.xml.transform.TransformerFactory","org.apache.xalan.xsltc.trax.TransformerFactoryImpl");
TransformerFactory tFactory = TransformerFactory.newInstance();%>
<%
try {
StreamSource xsl = new StreamSource(new FileInputStream("D:/translets/pr.class"));
StreamSource xml = new StreamSource(new FileInputStream( "D:/translets/pr.xml"));
StreamResult htm = new StreamResult(new FileOutputStream( "D:/birds.htm"));
Transformer transformer =tFactory.newTransformer(xsl);
transformer.transform(xml,htm);}
catch(Exception e){out.println("Compilation problem");}
%>

Similar Messages

  • Accessing another par file jsp pages

    Hi
    i need to access another par file JSP pages from my par file, what all i need.
    any help is appreciated.
    Thanks,
    Damodhar.

    Gandhi,
    Well..there is a very good article on how to use resources(watever resources u mentioned) of one par inside any other par file on SDN:
    Here is the document:<a href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b3c1af90-0201-0010-c0ac-c8d802d264f0">JSPs, Resources...</a>
    Xml files i worked were not property files of an iview.
    They were application specific xml files.I read these xml files on a different par(or iview).For that matter, they don need not be of type xml,could be any type of resource.
    Regards,
    P.

  • Accessing translets in a JSP

    Hi,
    I have a tranlset[compiled XSLT].I want to use it in a JSP page for transforming a XML into HTML.Is there any methods available to use the translet class file in a JSP page.Give a solution.

    using class files in jsp
    <%@ page import="import org.w3c.dom.*,import javax.servlet.http.*,import javax.xml.transform.*,import javax.xml.transform.stream.*,import java.io.*"%>
    <%
    try
    String strXML= "employee.xml";
    String xslFile = "employeeId.xsl";
    TransformerFactory tFactory = TransformerFactory.newInstance();
    StreamResult theTransformationResult = new StreamResult( new ByteArrayOutputStream() );
    Transformer transformer = tFactory.newTransformer(new StreamSource(xslFile));
    transformer.transform(new StreamSource(new StringReader(strXML)), theTransformationResult);
    out.println( theTransformationResult.getOutputStream());
    catch(Exception e){}
    %>
    check this code
    good luck

  • Accessing config object in jsp page

    I have been trying to access the config (implicit) object in my jsp page. In my web.xml, for my application, I have specified an init-parameter. To get the value of this parameter, I have the following code being executed
    <%
         String protocol = config.getInitParameter("protocol");
         out.println("Protocol = " +protocol);
    %>
    The output turns out to be Protocol = null.
    If I specify the init-parameter in Tomcat's web.xml in conf directory, then I do get the value. But that does not serve my purpose. I am using jakarta-tomcat-4.0-b7.
    Any suggestions!!!!!!!

    Try this link, http://archives2.real-time.com/rte-tomcat/2000/Apr/msg01124.html

  • Using translets in a JSP page

    Hi,
    I have a Translet [xslt file converted to a class file].I want to use the translets to transform the given XML to HTML in a JSP page.I am able to perform the transformation,by using XSLT file directly without converting it into a class file.But when I have a translet I dont know how to perform the transformation.Give me a solution.
    Reagrds,
    vimal

    Refer to
    http://xml.apache.org/xalan-j/samples.html#translets
    www.devx.com/Java/Article/19938/0/page/4

  • Message bundles accessed from JSF and JSP pages

    Hello, everybody!
    I'm developing a localized JSF application. It is working pretty well until now.
    These are my message files:
    mensagens.properties
    mensagens_en_US.propertiesThis is how they're configured in faces-config.xml:
    <application>
        <resource-bundle>
            <base-name>br.urca.www.biblioteca.web.mensagens</base-name>
            <var>msg</var>
        </resource-bundle>
    </application>And this is how I access the messages in a page:
    <h:outputText value="#{msg.titulo}" />Nothing new until now. But now there was a need for me to have a raw jsp page in
    my web application. This page is displaying ok but I also need to access the
    message bundles as I'm able to access in the normal jsp with the JSF components.
    As you should know I can't use something like the above code with an +<h:outputText>+
    to access the messages because this is a JSF component and I'll not be able to use
    JSF components with this raw jsp page.
    So, my question is: how do I access my localized messages from a raw jsp page? I
    suppose there should be a way to do this, but unfortunately I started programming
    to the web world in Java with JSF, not JSP, so I don't know how to do this with
    JSP.
    Thank you very much.
    Marcos

    BalusC wrote:
    Just include [jstl-1.2.jar|https://maven-repository.dev.java.net/repository/jstl/jars/] in your classpath and define the fmt taglib in your JSP. Nothing more is needed.
    Hello, BalusC. Thank you for your help. We're almost there. After I have included the jstl-1.2.jar you provided me I can use the fmt tag and access message bundles from my raw jsp page (even though I had to provide other message bundles instead of the ones that I use in the other jsf pages, but it's better than nothing).
    Now there just on problem to be fixed. The jsp page is not aware when I change the locale of my application. I change this locale in a jsf page.
    I have this component:
    <h:selectOneMenu value="#{pesquisaAcervo.idiomaAplicacao}"
        valueChangeListener="# {pesquisaAcervo.idiomaAplicacaoMudado}" onchange="submit();">
        <f:selectItems value="#{pesquisaAcervo.idiomasAplicacao}" />
    </h:selectOneMenu>that calls this event in my backing bean class:
    public void idiomaAplicacaoMudado(ValueChangeEvent e)
        fIdiomaAplicacao.liberarItens();
        Idioma idioma = Idioma.deString(e.getNewValue().toString());
        // This line is for JSF
        FacesContext.getCurrentInstance().getViewRoot().setLocale(idioma.localidade());
        // This line is for Tiles
        FacesContext.getCurrentInstance().getExternalContext().getSessionMap().
            put(org.apache.tiles.locale.impl.DefaultLocaleResolver.LOCALE_KEY, idioma.localidade());
    }So, do I have to include another line in the idiomaAplicacaoMudado event above in order for the jsp page load the correct resource bundle? Or what else do I have to do?
    Thank you.
    Marcos

  • Problem with access to SipFactory from jsp-pages in JBoss environment

    Hello!
    I have an installation of the OCMS 10.1.3.3. deployed into a JBoss (jboss-4.0.5.GA) environment. Unfortunately I have a problem with accessing the SipFactory from a jps-page. Encouraged by the "messagesender" example I tried to get an instance of SipFactory from my jsp-page simply by calling:
    SipFactory sipFactory = (SipFactory) application.getAttribute(SipServlet.SIP_FACTORY);
    But unfortunately there seems to be no attribute "SipServlet.SIP_FACTORY" and I only get a null pointer. I have also tried running that code in the orignal messagesender example but it didn't work either. So I wonder if this should definetely work in a JBoss environment or if this might be a known problem. Is there anything that I could check/do regarding this problem? I suppose there must be an oracle module which should take care of making the SipFactory availabe after it is deployed. Perhaps something went wrong during the deployment?!
    Best regards,
    Tim

    Hi
    On JBoss, OCMS does not support converge applications.
    I.e the SipFactory can be retrieved from the servlet context when running on OC4J.
    Instead the SipFactory can be found in JNDI as described in the Developer's Guide:
    "External Access to SIP Servlets
    To enable convergent applications between SIP and HTTP, the OCMS Container allows you to get access to the javax.servlet.sip.SipFactory by looking it up through JNDI. The SIP Factory will be registered under the same name as the display name of your SIP servlet as illustrated in Example 2–12. The <display-name> in the sip.xml in this case must be "My sip app".
    Example 2–12 Accessing the Data for a SIP Session through JNDI
    InitialContext ic = new InitialContext();
    SipFactory sipFactory = (SipFactory)ic.lookup("sip/My sip app");"
    Cheers
    Lucas Persson

  • How to access class method in jsp page

    hi ,
    I am new to JSP . I want to access a method returning an arraylist
    of a class.
    this class i saved in WEB-INF>classes folder > where other classes like logonform , etc. are saved ....
    import stmt is <%@ page import="java.io.*, java.util.*, readXml " %>
    <% readXml rd= new readXml();
    Arraylist list=rd.parseDoc();
    %>
    It is not recognizing readXml class......
    Can any body help me in this regard......
    plz help .... i m in urgent need
    thanks in advance.......

    better to put class in a pkg inside webinf> classes folder ...
    but in my case constructor was not public......
    public readXml(){}
    now it works fine...... :)

  • Accessing session attribute in output jsp page

    Hi i am not getting any output in jsp page...
    i am getting just heading
    i think some problem with Session attribute..
    if so how to access session been in jsp page
    my code is here
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%--
    The taglib directive below imports the JSTL library. If you uncomment it,
    you must also add the JSTL library to the project. The Add Library... action
    on Libraries node in Projects view can be used to add the JSTL 1.1 library.
    --%>
    <%--
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    --%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Tauvex Search Output</title>
    </head>
    <body>
    Tauvex Search Output
    <table>
    <c:forEach items="${myDataList}" var="myData">
    <tr>
    <td>${myData.Fitsfilename}</td>
    <td>${myData.RA_START}</td>
    <td>${myData.RA_END}</td>
    <td>${myData.DEC_START}</td>
    <td>${myData.DEC_END}</td>
    <td>${myData.telescope}</td>
    <td>${myData.STARTOBS}</td>
    <td>${myData.ENDOBS}</td>
    <td>${myData.FILTER}</td>
    </tr>
    </c:forEach>
    </table>
    <%--
    This example uses JSTL, uncomment the taglib directive above.
    To test, display the page like this: index.jsp?sayHello=true&name=Murphy
    --%>
    <%--
    <c:if test="${param.sayHello}">
    <!-- Let's welcome the user ${param.name} -->
    Hello ${param.name}!
    </c:if>
    --%>
    </body>
    </html>
    plz reply soon
    thanks a lot

    this is what i set in servlet
    request.setAttribute("myDataList", myDataList);
    request.getRequestDispatcher("someJspFile.jsp").forward(request, response);
    how can i access that session attribute in jsp

  • JSP pages not working

    I installed Apache 2.0.47, JSDK 2.0, and JServ 1.1.2 and copied all my JSP files in the htdocs directory in the Apacche installed folder. When I accessed one of my JSP page using IE 6.0, the file contents are loading, not the page! what is wrong with me? where I have to copy the .class files?
    On replying for this doubt, you are doing a great job. Thank you.

    You probably have to do something special to tell Apache to forward servlet/JSP requests to JServ.
    I've done such a thing with Tomcat. Look at the docs for JServ to see what they expect you to do.
    Why JServ? Why not Tomcat? It's free, and there's lots of on-line docs and books to help you get started.
    It's obvious that you're just starting with servlets and JSPs, Sunil. Go download Tomcat, get a couple of good books, and start reading and programming. You're not going to get your project off the ground by posting ill-posed questions to these forums every time you run into difficulty. Just some advice. - MOD

  • Java.lang.NumberFormatException while retriving detail in jsp page

    inside ActionClass(in struts i have )i am taking msgno as a input
    ArrayList arry=new ArrayList();
    Message msg=null;
    Address[] from=null;
    Date date=null;
    Address[] recipients=null;
    String subject=null;
    String contType=null;
    Object msgBody=null;
    BodyBn bbn=null;
    System.out.println("inside bussiness");
    Properties props = new Properties( );
    props.put("mail.debug","true");
    final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
    final String host = "pop.gmail.com";
    final String port="995";
    final String username = "[email protected]";//my mail id
    final String password = "######### "; //my password
    String provider = "pop3";
    props.put("mail.pop3.host",host);
    props.put("mail.pop3.user",username);
    props.put("mail.pop3.port",port);
    props.setProperty( "mail.pop3.socketFactory.port", "995");
    props.setProperty( "mail.pop3.socketFactory.class", SSL_FACTORY);
    props.setProperty("mail.pop3.socketFactory.fallback", "false");
    try {
    Session session = Session.getInstance(props,new javax.mail.Authenticator() {
    protected PasswordAuthentication getPasswordAuthentication() {
    return new PasswordAuthentication(username,password);     }
    Store store = session.getStore(provider);
    store.connect(host, username, password);
    boolean b=store.isConnected();
    if(b==true) {
    System.out.println("************conneted to pop server***********");
    Folder inbox = store.getFolder("INBOX");
    if (inbox == null) {
    System.out.println("No INBOX");
    System.exit(1);
    inbox.open(Folder.READ_ONLY);
    msg = inbox.getMessage(msgno);
    from= msg.getFrom();
    date=msg.getSentDate();
    recipients=msg.getAllRecipients();
    subject=msg.getSubject();
    contType= msg.getContentType();
    msgBody=msg.getContent();
    System.out.println("msg is from "+from);
    System.out.println("msg date "+date);
    System.out.println("msg recipients "+recipients);
    System.out.println("msg sub is "+subject);
    System.out.println("msg conttype "+contType);
    System.out.println("msg body is "+msgBody);
    bbn=new BodyBn(from,date,recipients,subject,contType,msgBody);
    System.out.println("----------adding to arry list--------------");
    arry.add(bbn);
    req.setAttribute("msgDetail",arry);
    return mapping.findForward("success");
    }catch(Exception e) {
    System.out.println("Exception***********");
    ------------------------------in jsp page i m retriving all data--------------------------------
    <body>
    <logic:present name="msgDetail">
    <table>
    <tr>
    <td>${msgDetail.from[0]}</td>
    </tr>
    <tr>
    <td>${msgDetail.recipients[0]}</td>
    </tr>
    <tr>
    <td>${msgDetail.subject}</td>
    </tr>
    <tr>
    <td>${msgDetail.contType}</td>
    </tr>
    <tr>
    <td>${msgDetail.msgBody}</td>
    </tr>
    </table>
    </logic:present>
    while printing these data in to console it is showing all data properly
    but when i am trying to access these data from jsp page it is giving me
    Following exception
    java.lang.NumberFormatException: For input string: "from"
         java.lang.NumberFormatException.forInputString(Unknown Source)
         java.lang.Integer.parseInt(Unknown Source)
         java.lang.Integer.parseInt(Unknown Source)
         javax.el.ListELResolver.coerce(ListELResolver.java:166)
         javax.el.ListELResolver.getValue(ListELResolver.java:51)
         javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
    Plz help for this problem

    This problem doesn't seem to have anything to do with JavaMail.
    You'll probably have better luck in a Struts or JSP forum.

  • How to access class members in jsp??

    i m working in jsp and i make a class Student having attribute name and id and i store it at tomcat\classes\Student.java
    and i store a jsp page at tomcat\webapps\root\student\index.jsp
    now i create object of class Student in jsp page it works
    but when i try to access name(Student.name) or id(Student.id)(or any class member of Student class)it shows error message
    now pls tell me how can i access class members in jsp page.

    i m working in jsp and i make a class Student having attribute name and id and i store it at tomcat\classes\mypack\Student.java
    and i store a jsp page at tomcat\webapps\root\student\index.jsp
    now i create object of class Student in jsp page it works
    but when i try to access name(Student.name) or id(Student.id)(or any class member of Student class)it shows error message
    now pls tell me how can i access class members in jsp page.
    Note: class members r public.

  • Setup mySQL and access the same from jsp

    Hi,
    I have installed the MySQL in local desktop in d: drive. As per the documentation, have created my.cnf file to point sql directory in d drive.
    Now I dont know how to proceed further. I need to see if MySQL installation is fine, create table and access the data in jsp page. Please advice.
    Thanks in advance.

    For MySQL help try a MySQL forum.
    For connecting to the database, use JDBC. You can get the MySQL JDBC driver from www.mysql.com.
    From there just follow standard java database connection setup.
    http://java.sun.com/docs/books/tutorial/jdbc/index.html

  • Why doesn't doFilter work was expected when a .jsp page is accessed?

    I'm hoping an expert could point me in the right direction or tell me
              if this is a bug in WebLogic.
              My environment is WebLogic 6.1 (service pack 4), on Windows 2000.
              I need to capture all the response data that comes back from the
              servlet. So, I have a simple filter that wraps the response object,
              and sends the wrapped object into filterChain.doFilter() method.
              I've set up the web.xml so that any servlet access should trigger my
              filter (the <url-pattern> is /*). I've also configured a sample
              web-app called TEST to serve .html/.jsp pages.
              When the browser makes a .html request, everything works as expected.
              After the filterChain.doFilter(), I can take a look at the wrapped
              response object and print the contents of the response.
              However, when I access a .jsp page as part of form data submit, the
              output stream of my wrapper is empty after the filterChain.doFilter()
              completes.
              If I don't wrap the response, then everything seems to work fine. The
              .jsp gets interpreted properly by the servlet container, I can see the
              result page in the browser just fine.
              By inserting debug statements, I can see that if I wrap the responses,
              for a .html request, under the covers, wrapper's getOutputStream()
              gets called. But for a .jsp request, under the covers, wrapper's
              getWriter() gets called. I don't know how significant this is, but
              this is the only difference I see!
              If I don't wrap the response, I am not sure how to get at the response
              data. All I need to do is to take certain actions depending on the
              response. That is why I'm using a wrapper to get at the response data.
              In the JRun AppServer, the code just works fine.
              I've enclosed the source code & the output that demonstrates the
              problem.
              What am I doing wrong? Or, is this a bug in WebLogic? If this is a
              bug, is there a patch available?
              Thanks,
              --Sridhar
              // HeaderFilter.java
              // This is the filter that gets invoked through the web.xml
              configuration
              import javax.servlet.*;
              import javax.servlet.http.*;
              import java.io.*;
              import java.util.*;
              public class HeaderFilter implements Filter {
              public FilterConfig filterConfig;
              public void destroy() {
                        this.filterConfig = null;
                   public void init(FilterConfig filterConfig) {
                        this.filterConfig = filterConfig;
              public FilterConfig getFilterConfig() {
              return filterConfig;
              public void setFilterConfig(FilterConfig filterConfig) {
              this.filterConfig = filterConfig;
              public void doFilter(ServletRequest req, ServletResponse resp,
              FilterChain chain)
              throws java.io.IOException, javax.servlet.ServletException {
              ServletContext context = filterConfig.getServletContext();
              HttpServletResponse response = (HttpServletResponse)resp;
              TestResponseWrapper wrapper = new
              TestResponseWrapper(response);
              chain.doFilter(req, wrapper);
              OutputStream out = resp.getOutputStream();
              System.out.println("The content length is :" +
              wrapper.getContentLength());
              if ("text/html".equals(wrapper.getContentType())) {
              byte[] data = wrapper.getData();
              System.out.println("TEXT RESPONSE, length is " +
              data.length);
              System.out.println(new String(data));
              out.write(data);
              // out.close();
              // TestResponseWrapper.java
              // This class wraps the response object so that you could take a look
              at
              // the response contents after the filterConfig.doFilter() method
              import javax.servlet.ServletOutputStream;
              import javax.servlet.http.HttpServletResponse;
              import javax.servlet.http.HttpServletResponseWrapper;
              import java.io.ByteArrayOutputStream;
              import java.io.PrintWriter;
              public class TestResponseWrapper extends HttpServletResponseWrapper{
              private ByteArrayOutputStream output;
              private int contentLength;
              private String contentType;
              public TestResponseWrapper(HttpServletResponse response) {       
              super(response);
              output = new ByteArrayOutputStream();
              public ServletOutputStream getOutputStream() {    
              System.out.println("****** getOutputStream() called *******");
              return new FilterServletOutputStream(output);
              public byte[] getData() {
              return output.toByteArray();
              public PrintWriter getWriter() {   
              System.out.println("****** getWriter() called *******");
              return new PrintWriter(getOutputStream(), false);
              public void setContentType(String type) {       
              System.out.println("**** Wrapper setContentType called ****");
              this.contentType = type;
              super.setContentType(type);
              public String getContentType() {       
              return this.contentType;
              public int getContentLength() {    
              return contentLength;
              public void setContentLength(int length) {       
              System.out.println("**** Wrapper setContentLength called
              this.contentLength=length;
              super.setContentLength(length);
              // FilterServletOutputStream.java
              // This class is used by the wrapper for getOutputStream() method
              // to return a ServletOutputStream object.
              import javax.servlet.ServletOutputStream;
              import java.io.DataOutputStream;
              import java.io.IOException;
              import java.io.OutputStream;
              import java.io.*;
              public class FilterServletOutputStream extends ServletOutputStream {
              private DataOutputStream stream;
              public FilterServletOutputStream(OutputStream output) {       
              stream = new DataOutputStream(output);
              public void write(int b) throws IOException {       
              stream.write(b);
              public void write(byte[] b) throws IOException {       
              stream.write(b);
              public void write(byte[] b, int off, int len) throws IOException {
              stream.write(b, off, len);
              // test.html
              <html>
              <head>
              <meta http-equiv="Content-Type"
              content="text/html; charset=iso-8859-1">
              <title> Web Posting Information </title>
              </head>
              <body>
              <form name="myform" method="POST" action="resource.jsp">
              <input type="TEXT" name="input"></input>
              <br>
              <input type="SUBMIT" value="done"></input>
              </form>
              </body>
              </html>
              // resource.jsp
              // This gets referenced by the test.html file
              <HTML><BODY>
              <head>
              <title>JRun Programming Techniques</title>
              <meta http-equiv="Content-Type" content="text/html;
              charset=iso-8859-1">
              </head>
              <body>
              <H3>Secure Resource Page</H3>
              <p>This is a secure page.</p>
              <BR><B>User: </B>
              <%
              //     out.write(request.getParameter("input"));
              %>
              </BODY></HTML>
              // HERE IS THE OUTPUT
              // HERE IS WHAT I SEE WHEN I ACCESS
              // http://localhost:7001/TEST/test.html
              **** Wrapper setContentType called ****
              **** Wrapper setContentLength called ****
              ****** getOutputStream() called *******
              The content length is :331
              TEXT RESPONSE, length is 331
              <html>
              <head>
              <meta http-equiv="Content-Type"
              content="text/html; charset=iso-8859-1">
              <title> Web Posting Information </title>
              </head>
              <body>
              <form name="myform" method="POST" action="resource.jsp">
              <input type="TEXT" name="input"></input>
              <br>
              <input type="SUBMIT" value="done"></input>
              </form>
              </body>
              </html>
              // HERE IS WHAT I SEE WHEN I enter some value in the "input" field
              // of the form, and click on the "submit" button.
              // Why isn't setContentLength() getting called on the wrapper?
              // It appears as if the wrapper's output stream isn't getting used
              // at all!!!
              **** Wrapper setContentType called ****
              ****** getWriter() called *******
              ****** getOutputStream() called *******
              The content length is :0
              TEXT RESPONSE, length is 0
              

    If someone else runs into this, here is how I solved the problem -
              If you create a PrintWriter object with the autoflush option, it
              doesn't flush the underlying buffer till you call println on it. I
              looked through the generated code for the servlet, and it was doing a
              JSPWriter.print() to output information.
              So, I changed the ResponseWrapper to keep a handle to the PrintWriter
              object, and then flush it in the filter, and that works.
              Why the same code behaves differently in JRun & Weblogic, I'm not sure
              --Sridhar
              

  • How can I access xml document from javascript whithin a JSP page

    how can I access xml document from javascript whithin a JSP page?
    I have a JSP that receives an XML document from a JavaBean, so I can access it within the entire JSP, but I need to access it from the javascript inside the JSP... and I have no idea how i can do this.
    Thanks in advance!

    The solution would only work on MS IE browsers, as other browsers do not support an XML DOM.
    It can be done, but you would be stuck with using the Microsoft broswer. If that is acceptable, I have some example code, and a book recommendation.

Maybe you are looking for

  • HP Photosmart D7260 driver issues

    I have this printer and only plug it into my laptop when i need to print, with usb cable.... yesterday it didnt' recogonize the printer at all after plugging it in, so i deleted all the printers in my printers folder.... i have window vista and have

  • How do I stop an album appearing multiple times in album view?

    Whenever I try to look at albums in album view some of them are appearing multiple of times. I have gone through everything I can think of made sure that all the sort fields are the same etc, yet they still appear more than once. Now with the update

  • Mail Server Installation on xMII Server

    Hi All, I had installed mail server on xMII Server and created a mail account there. Inside the BLS I used localhost as server. And username and password, I given the credentials of mail account created. The problem is I am not able to send mails(Eve

  • How to Enable Headphone/Mic and External Speakers at On

    Hey!?Just bought the Sound Blaster X-Fi XtremeGamer Fatalty Professional card to put in a new system I'm building. I wanted to use this instead of the one that had the 5.25" dri've bay connection because my PC's front panel closes over those bays and

  • Even logon distribution using load balancing

    We are trying to scale our system to distribute logons across multiple app servers. We have setup Logon groups and have set MSHOST in our connection configurations but since all logon's occur at roughly the same time, they all end up going to the sam