In the Generated Servlet

Hi,
In the generated servlet, where does this methodA and methodB come....
<%!
char[] header;
public void methodA(){
%>
<%
char footer;
char[] header; // is this allowed, can i declare a same variable in the initialization block and scriptlet block
public void methodB(){
%>
Regards
AMJ

The generated code would end up something like this:
public class myJSP implements javax.servlet.jsp.HttpJspPage{
char[] header;
public void methodA(){
public void _jspService(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException{
  char footer;
  char[] header; // is this allowed, can i declare a same variable in the initialization block and scriptlet block
  public void methodB(){
}The header is perfectly valid - it just declares a variable local to the _jspService method
methodB is invalid - you can't declare a method inside another method.
Cheers,
evnafets

Similar Messages

  • JSP compiler obfuscates generated servlet debug line numbers

              Here's something that's been baffling me for a couple of days now.
              When WebLogic parses a JSP into servlet Java source, and then compiles the Java
              source into a class, it seems to perform a further step to obfuscate debug line
              numbers in the _jspService method. This converts the debug line numbers from Java
              source code line numbers into JSP line numbers.
              At first sight, this may appear to be useful- it means that when an exception
              is thrown then it references a line number in the original JSP rather than one
              in the generated servlet. However, it actually makes life more difficult when
              you consider included JSPs.
              Suppose you have a file loginresult.jsp, which uses @include to include a header.jsp
              and footer.jsp, both of which contain dynamic content. When WebLogic converts
              line numbers, it ignores the JSP that the code came from, so this causes a many-to-one
              mapping of line numbers. When an error occurs, the exception will tell you the
              line number that it came from, but it won't tell you which JSP caused it. The
              many-to-one mapping ensures a loss of information- and no way of retrieving the
              real line numbers.
              This is an even bigger nuisance when trying to debug JSPs- the debugger hops around
              in the generated servlet file without giving any clue as to whereabouts it really
              is in the code.
              My question is: is there any way of switching off this post-processor behaviour?
              One obvious way would be to locate the WebLogic class that does this post-processing,
              stub it out and run WebLogic with this class higher up in the classpath. But that's
              a last resort.
              Secondly, would there be any other impact in turning off this behaviour? Do other
              parts of WebLogic rely on this?
              Thanks in advance,
              Kevin.
              

    Actually, this option turns line-number table replacement on and off, for example,
              with jsp like this:
              test.jsp
              <%
              throw new Exception();
              %>
              and weblogic.xml:
              <!DOCTYPE weblogic-web-app PUBLIC "-//BEA
              Systems, Inc.//DTD Web Application 7.0//EN"
              "http://www.bea.com/servers/wls700/dtd/weblogic700-web-jar.dtd">
              <weblogic-web-app>
              <jsp-descriptor>
              <jsp-param>
              <param-name>debug</param-name>
              <param-value>true</param-value>
              </jsp-param>
              </jsp-descriptor>
              </weblogic-web-app>
              the stacktrace looks like this (note line number 2 - this is JSP line number):
              java.lang.Exception
              at jsp_servlet.__test._jspService(test.jsp:2)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:945)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:332)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:376)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:242)
              at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5360)
              at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:721)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3043)
              at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2468)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
              and with debug option turned off:
              <!DOCTYPE weblogic-web-app PUBLIC "-//BEA
              Systems, Inc.//DTD Web Application 7.0//EN"
              "http://www.bea.com/servers/wls700/dtd/weblogic700-web-jar.dtd">
              <weblogic-web-app>
              <jsp-descriptor>
              <jsp-param>
              <param-name>debug</param-name>
              <param-value>false</param-value>
              </jsp-param>
              </jsp-descriptor>
              </weblogic-web-app>
              exception stacktrace looks like this (note that line number now is from generated .java file):
              java.lang.Exception
              at jsp_servlet.__test._jspService(__test.java:87)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:945)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:332)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:376)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:242)
              at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5360)
              at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:721)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3043)
              at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2468)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
              Kevin Thomas <[email protected]> wrote:
              > But this isn't useful, as you don't know which JSP the line number is referring
              > to! (did it come from the main JSP, or one of the files that it included?)
              > Turning debug off is not an answer- because that will lose other useful information
              > that is useful to the debugger.
              > Kevin.
              > "Dimitri I. Rakitine" <[email protected]> wrote:
              >>Actually, this is useful when you want to debug .jsp's and not generated
              >>..java files. Did you try setting 'debug' jsp-param in the weblogic.xml
              >>to
              >>false? I think it turns class postprocessing on and off.
              >>
              >>Kevin Thomas <[email protected]> wrote:
              >>
              >>> Here's something that's been baffling me for a couple of days now.
              >>
              >>> When WebLogic parses a JSP into servlet Java source, and then compiles
              >>the Java
              >>> source into a class, it seems to perform a further step to obfuscate
              >>debug line
              >>> numbers in the _jspService method. This converts the debug line numbers
              >>from Java
              >>> source code line numbers into JSP line numbers.
              >>
              >>> At first sight, this may appear to be useful- it means that when an
              >>exception
              >>> is thrown then it references a line number in the original JSP rather
              >>than one
              >>> in the generated servlet. However, it actually makes life more difficult
              >>when
              >>> you consider included JSPs.
              >>
              >>> Suppose you have a file loginresult.jsp, which uses @include to include
              >>a header.jsp
              >>> and footer.jsp, both of which contain dynamic content. When WebLogic
              >>converts
              >>> line numbers, it ignores the JSP that the code came from, so this causes
              >>a many-to-one
              >>> mapping of line numbers. When an error occurs, the exception will tell
              >>you the
              >>> line number that it came from, but it won't tell you which JSP caused
              >>it. The
              >>> many-to-one mapping ensures a loss of information- and no way of retrieving
              >>the
              >>> real line numbers.
              >>
              >>> This is an even bigger nuisance when trying to debug JSPs- the debugger
              >>hops around
              >>> in the generated servlet file without giving any clue as to whereabouts
              >>it really
              >>> is in the code.
              >>
              >>> My question is: is there any way of switching off this post-processor
              >>behaviour?
              >>> One obvious way would be to locate the WebLogic class that does this
              >>post-processing,
              >>> stub it out and run WebLogic with this class higher up in the classpath.
              >>But that's
              >>> a last resort.
              >>
              >>> Secondly, would there be any other impact in turning off this behaviour?
              >>Do other
              >>> parts of WebLogic rely on this?
              >>
              >>> Thanks in advance,
              >>
              >>> Kevin.
              >>
              >>--
              >>Dimitri
              >>
              Dimitri
              

  • The XML generated by the Lotus servlet component is not well formed

    Hello Experts,
    While integrating EP7 to Lotus Domino 7 we are facing some problem with XML parser.
    We have following configuration
    EP7 SP 13
    Lotus Domino 7
    All configurations related to SSO are done. SSO is working fine.
    All transports are created properly. All services active
    Please suggest some solution
    The error is displayed when i try to access the calendar related objects, like calendar, appointments etc.
    Here is error detail:
    The XML generated by the Lotus servlet component is not well formed com.sap.ip.collaboration.gw.impl.transport.lotus.exception.XMLParserException: The XML generated by the Lotus servlet component is not well formed
         at com.sap.ip.collaboration.gw.impl.transport.lotus.LotusCalendarTransport.getXmlDocument(LotusCalendarTransport.java:997)
         at com.sap.ip.collaboration.gw.impl.transport.lotus.LotusCalendarTransport.readResponse(LotusCalendarTransport.java:1922)
         at com.sap.ip.collaboration.gw.impl.transport.lotus.LotusCalendarTransport.getLotusServerTz(LotusCalendarTransport.java:405)
         at com.sap.ip.collaboration.gw.impl.transport.lotus.LotusCalendarTransport.getItemList(LotusCalendarTransport.java:377)
         at com.sap.ip.collaboration.gw.impl.framework.groupware.GroupwareManager.getItemList(GroupwareManager.java:263)
         at com.sap.ip.collaboration.gw.impl.manager.calendar.ContentManager.getChildren(ContentManager.java:237)
         at com.sapportals.wcm.repository.CollectionImpl.internalGetChildrenManager(CollectionImpl.java:1538)
         at com.sapportals.wcm.repository.CollectionImpl.internalGetChildren(CollectionImpl.java:1555)
         at com.sapportals.wcm.repository.CollectionImpl.doGetChildren(CollectionImpl.java:144)
         at com.sapportals.wcm.repository.CollectionImpl.getChildren(CollectionImpl.java:124)
         at com.sap.ip.collaboration.gwui.api.GWUtils.getAllCalendarItems(GWUtils.java:180)
         at com.sap.ip.collaboration.gwui.api.htmlb.component.day.DayControlDynPage.doProcessBeforeOutput(DayControlDynPage.java:65)
         at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:123)
         at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
         at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
         at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:645)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
         at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
         at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
         at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:524)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:407)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Waiting for replies
    Regards
    Kedar Kulkarni
    Do Not worry for points.

    Hello Michael Sambeth and all Lotus experts,
    I read about a tool for Lotus Domino Ticket Verifier that is delivered by SAP.
    Can you please send it to kedar.c.kulkarni @ gmail.com
    I actually posted a thread, but could not get any reply for SAP standard error: GW-LOT-014
    regards
    Kedar Kulkarni
    Edited by: Kedar Kulkarni on Apr 9, 2008 12:11 PM

  • Deploying web applications - jsp generated servlet's may be written over the same file!

    Hi, I have made the following test:
    Created two simple web applications with one jsp page, and deployed it
    with different context names, in weblogic.properties I have:
    weblogic.httpd.webApp.weirdApp=\java\weblogic\myserver\weirdApp.war
    weblogic.httpd.webApp.weirdAppTwo=\java\weblogic\myserver\weirdAppTwo.war
    (Note: I have used two diferent war files, because I have a different
    implementation of the jsp page, I could have used the same warfile, and
    deployed it two times with the same different names I have used)
    These two applications have a jsp named myHomePage.jsp
    If I access the first application, like this:
    http://myServer:7001/weirdApp/myHomePage.jsp
    the servlet for myHomePage is created in
    /java/weblogic/myserver/WEB-INF/_tmp_war/jsp_servlet/_myhomepage.class
    If I access the second application, like this:
    http://myServer:7001/weirdAppTwo/myHomePage.jsp
    the servlet for myHomePage is created in
    /java/weblogic/myserver/WEB-INF/_tmp_war/jsp_servlet/_myhomepage.class
    It overrides the first one! Because the servlets are keeped in memory by
    a different class loader this seems to not affect the other servlet, but
    I am wondering what may happen with this strange beaver from weblogic!
    Bruno Antunes,
    Java Software Engineer
    email: mailto:[email protected]
    Phone: +351.21.7994200
    Fax : +351.21.7994242
    WhatEverSoft - Java Center
    Centro de Competencia Java
    Praca de Alvalade, 6 - Piso 4
    1700-036 Lisboa - Portugal
    URL: http://www.whatevernet.com
    ****************** Internet Mail Footer ****************************
    A presente mensagem pode conter Informação considerada Confidencial.
    Se o receptor desta mensagem não for o destinatário indicado, fica
    expressamente proibido de copiar ou endereçar a mensagem a terceiros.
    Em tal situação, o receptor deverá destruir a presente mensagem e
    por gentileza informar o emissor de tal facto.
    Privileged or Confidential Information may be contained in this
    message. If you are not the addressee indicated in this message,
    you may not copy or deliver this message to anyone. In such case,
    you should destroy this message and kindly notify the sender by
    reply email.

    I have a separate java class that gets my data and returns a Result object. Do you mean java.sql.ResultSet?
    In my main servlet I do the following:
    request.setAttribute("supporttracker",
    supporttracker.findsupporttracker(monthYear));
    and then in my JSP I can iterate through the Result
    like the following with no problems:
    <c:forEach var="supporttracker" begin="0"
    items="${supporttracker.rows}" varStatus="counter">
    My problem is that I can only iterate through this
    once in the page whereas I have no problem doing
    multiple forEach loops through other types of
    lists/collections such as an ArrayList. Right, because a ResultSet is a database cursor and doesn't act the same way that an ArrayList does. It's more like an InputStream - once you read it, you close it. If you want to re-read it, you have to re-initialize it again.
    Iterators behave that way, too. Once you walk through them, you have to re-initialize them.
    I've looked
    on the web and in a couple of books, I first thought
    it may be scope or some attribute in forEach that I
    was missing but I'm stumped. It seems like it's
    because the pointer to the result set is at the end
    of the result set when trying the second iteration,
    but I thought by using the begin="0" would put the
    pointer at the first row again, on my second
    iteration I'm getting no rows/data outputed.
    Please help and thanks in advance!The better thing to do is for your method to return a List of objects, one per row, that represent what the ResultSet returns. Have that method iterate through the ResultSet, loading the rows into the List, and close it before you leave in a finally block. A database cursor is a scarce resource, so it's a good idea to close it as soon as you can.
    %

  • Problem with multiple Ajax calls to the same Servlet

    Hi,
    I am new to AJAX. I have a requirement where in, i have to make ajax calls to the same servlet in an infinite loop and check for an application context attribute to refresh the contents in the JSP.I am using the following script in JSP. The problem is i am not able to invoke the servlet more than one time.But I am able to go through the script at specific time interval using setInterval() function of Javascript and able to get alerts.But the problem is with xmlhttp.open("Get", url, true);. Its not getting called more than one time, even though i make multiple calls to the function.
    *<script type="text/javascript">*
    var xmlhttp
    var resp
    function fAjax()
    alert("Here");
    xmlhttp=null;
    resp=null;
    // code for Mozilla, etc.
    if (window.XMLHttpRequest)
    xmlhttp=new XMLHttpRequest();
    // code for IE
    else if (window.ActiveXObject)
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    if (xmlhttp!=null)
    xmlhttp.onreadystatechange=state_Change;
    xmlhttp.open("GET","/PSAPBackOffice/TestServlet",true);
    xmlhttp.send(null);
    else
    alert("Your browser does not support XMLHTTP.")
    function state_Change()
    // if xmlhttp shows "loaded"
    if (xmlhttp.readyState==4)
    // if "OK"
    if (xmlhttp.status==200)
         resp=xmlhttp.responseText;
         //alert(resp);
         if (resp=="CALL"){
         form.method="GET";
         form.action="/Project/Details.jsp          
    form.submit();
    else
    alert("Problem retrieving XML data")
    function callTimer(){
         setInterval("fAjax()",5000);
    *</script>*
    *Code for Servlet here:*
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException
    ServletContext objContext= getServletContext();
         String value;
         synchronized (objContext) {
                   value=(String) objContext.getAttribute("Flag");
                        if(value==null){
                        else if(value.equals("Done")){
                             response.setContentType(CONTENT_TYPE);
                             PrintWriter out = null;
                                  try {
                                       out = response.getWriter();
                                  } catch (IOException e) {
                                       // TODO Auto-generated catch block
                                       e.printStackTrace();
                                                                } catch (NullPointerException npe) {
                                       // TODO Auto-generated catch block
                                       npe.printStackTrace();
                             objContext.setAttribute("Flag","No");
                             out.println("CALL");
    Can someone figureout the problem or mistake and help me out.Its urgent and please help me in this regard.Thanks in Advance !

    I'm not sure I'm following you. The mapping from URL to servlet can contain anything you want. So you could have the URL /blah/blah/blah that, with a mapping something like /blah/* would pass all requests with that URL pattern to your servlet - no one has to know it is a servlet. Your servlet could then parse the URL to see what it has to do or you could pass parameters as part of the URL or as hidden fields.

  • Generated servlet error: method is undefined for type

    Hi,
    I keep getting the following error when I attempt to run my JSP:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 12 in the jsp file: /jsp-examples/JSPandMySQL/loginuser.jsp
    Generated servlet error:
    The method getValidUser() is undefined for the type LoginDetails
    In my JSP file I have the code:
    <%
    boolean validName = login.getValidUser();
    if(validName == false) {
    out.println("Invalid Username");
    } else {
    out.println("Valid Username");
    %>
    and the method getValidUser(); is in a Java Bean that I have created and the code for that method is just :
    public boolean getValidUser() {
    return valid;
    I've tried searching the net for some answers but none of the solutions given work for mine, I would be grateful for any advice on how to solve this program.

    DId you import the class at the top of the jSP? Does the method exist? Is the class compiled properly?
    - Saish

  • Generated servlet error - unable to compile class for JSP - using NB5.5/SS9

    I am using NB5.5 beta2 and Sun server 9.0 with JSF 1.1 - all is OK when I am creating firts JSF application - welcomeJSF.jsp page is rendered normally - but when I am adding one more jsp with JSP view and so on - then - I am getting errors in both JSF pages - both - in original welcomeJSF and the new invoice.jsp page
    here is code for typical error
    org.apache.jasper.JasperException: Unable to compile class for JSP
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    [javac] E:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-modules\ERPSolution\org\apache\jsp\welcomeJSF_jsp.java:99: cannot find symbol
    [javac] symbol : method setJspId(java.lang.String)
    [javac] location: class com.sun.faces.taglib.jsf_core.ViewTag
    [javac] jspxth_f_view_0.setJspId("id7");
    [javac] ^
    Generated servlet error:
    [javac] E:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-modules\ERPSolution\org\apache\jsp\welcomeJSF_jsp.java:144: cannot find symbol
    [javac] symbol : method setJspId(java.lang.String)
    [javac] location: class com.sun.faces.taglib.html_basic.OutputTextTag
    [javac] jspxth_h_outputText_0.setJspId("id17");
    [javac] ^
    Generated servlet error:
    [javac] E:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-modules\ERPSolution\org\apache\jsp\welcomeJSF_jsp.java:145: setValue(java.lang.String) in com.sun.faces.taglib.html_basic.OutputTextTag cannot be applied to (javax.el.ValueExpression)
    [javac] jspxth_h_outputText_0.setValue(org.apache.jasper.runtime.PageContextImpl.getValueExpression("Java Server Faces", (PageContext)_jspx_page_context, java.lang.Object.class, null));
    [javac] ^
    [javac] 3 errors
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:94)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:384)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:461)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:528)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:507)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:495)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:530)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:409)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:317)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:414)
         com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:455)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:139)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:159)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
         com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
         com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
         org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
         com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
         com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
         com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
         com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
         com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
         com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
         com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
    note The full stack trace of the root cause is available in the Sun Java System Application Server Platform Edition 9.0 logs.
    and there is output for another error:
    Generated servlet error:
    [javac] E:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-modules\ERPSolution\org\apache\jsp\welcomeJSF_jsp.java:144: cannot find symbol
    [javac] symbol : method setJspId(java.lang.String)
    [javac] location: class com.sun.faces.taglib.html_basic.OutputTextTag
    [javac] jspxth_h_outputText_0.setJspId("id17");
    [javac] ^
    Generated servlet error:
    [javac] E:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-modules\ERPSolution\org\apache\jsp\welcomeJSF_jsp.java:145: setValue(java.lang.String) in com.sun.faces.taglib.html_basic.OutputTextTag cannot be applied to (javax.el.ValueExpression)
    [javac] jspxth_h_outputText_0.setValue(org.apache.jasper.runtime.PageContextImpl.getValueExpression("Java Server Faces", (PageContext)_jspx_page_context, java.lang.Object.class, null));
    [javac] ^
    [javac] 3 errors
    and here is code of my new invoice.jsp page:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <%--
    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">
    <f:view>
       <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
          <h1><h:outputText value="Java Server Faces" /></h1>
        <h:inputText value="#{managerBean.currentInvoice.id}"/>
        <h:inputText value="#{managerBean.currentInvoice.description}"/>
        <h:inputText value="#{managerBean.currentInvoice.total}"/>
        <h:commandButton value="new_invoice"
                         type="submit"
                         actionListener="#{managerBean.createNewInvoice}"/> 
        </body>
    </f:view>and faces-config.xml file:
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <!-- =========== FULL CONFIGURATION FILE ================================== -->
    <faces-config>
        <managed-bean>
            <managed-bean-name>managerBean</managed-bean-name>
            <managed-bean-class>com.brl.ERPSolution.ui.ManagerBean</managed-bean-class>
            <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>
    </faces-config>managerBean was intended to be backing beans which will call the facaed beans of EJB 3.0 entity beans - but at presnet - almost empty methods are declared there:
    package com.brl.ERPSolution.ui;
    import javax.faces.event.ActionEvent;
    import com.brl.solutions.EJB3.*;
    * @author Administrator
    public class ManagerBean {
        protected int currentInvoiceId;
        protected Invoices currentInvoice;
        protected InvoicesFacade invoicesFacade;
        /** Creates a new instance of ManagerBean */
        public ManagerBean() {
        /* business methods */
        public void createNewInvoice(ActionEvent actionEvent)
            invoicesFacade.create(this.currentInvoice);
        public Invoices getCurrentInvoice()
            return this.currentInvoice;
        public void setCurrentInvoice(Invoices currentInvoice)
            this.currentInvoice=currentInvoice;
    }I read in one blog (actually - the only page which was returned by yahoo - so - this should be very rare error!!!) to try to use Sun server's verifier.bat - and - it reported 0 errors and 0 warning. Build was succesfull as well and also - deployment was without errors - but - above mentioned error appeared during the automatic compilation of jsp pages/servlet when newly deployed jsps are first accessed from remote browser.
    So - is it possible, please, to receive some advice - what to do further? I feel that my invoice.jsp page can be with errors, - however - the original welcomeJSF.jsp should be working without errors even the erronwous JFS jsp page is added to web application.
    Thans for any adice or hint in advance!!!

    OK - I have made 'clean and build main project' from NB menu and the deployed the resulting *.war and the error messages have disappeared... So - it seems to be bug...

  • Display a cruve and a table in the same servlet

    Hi,
    I want to display a curve in a servlet, I can do it, but I can't display the table which is after the curve, the code is the following :
    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
           XYDataset dataset = createDataset(pathFile, pathFileTimer);
          JFreeChart chart = createChart(dataset);
          resp.setContentType("image/png");
          OutputStream out1 = resp.getOutputStream();
          ChartUtilities.writeChartAsPNG(out1, chart, 800, 600);
          out1.close();
          PrintWriter out = resp.getWriter();
          out.println("<html>");
          out.println("<body>");
          out.println("<head>");
          out.println("<title>Informations batterie</title>");
          out.println("</head>");
          out.println("<body bgcolor=\"white\">");
          out.println("<TABLE id=\"Table1\" style=\"WIDTH: 864px; HEIGHT: 75px\" cellSpacing=\"1\" cellPadding=\"1\" width=\"864\" border=\"1\">");
    ...So how can I display the table in the same servlet ? Or perhaps can I display the curve in an another servlet, but it would be better to call this servlet automatically and not manually with a post method.
    Thanks for any help.

    So how can I display the table in the same servlet ?You can't. You either send HTML or you send PNG. You can't combine the two in the same request.
    Or perhaps can I display the curve in an another
    servlet, but it would be better to call this servlet
    automatically and not manually with a post method.Yes, you would use another servlet to display the curve. Servlet A would generate the HTML, including a link to Servlet B. I don't know what you think the difference between calling a servlet automatically and manually is, but if you use this two-step process:
    1. Decide what HTML you want the browser to see.
    2. Write code to produce that HTML.
    you will find things a lot less confusing.

  • How to delete the Generated files from application server(open hub)?

    hi experts,
    when i try to execute process chain the DTP it is giving below dump. Exception CX_RSBK_REQUEST_LOCKED logged.
    when i execute the DTP manually and trying to delete the previous request, it is giving for dump ITAB_DUPLICATE_KEY.
    so to delete the generated file from application server, how to delete it for specific dates?
    Information on where terminated
    Termination occurred in the ABAP program "GPD6S3OE0BCVGC6L9DBNVYQARZM" - in
    "START_ROUTINE".
    The main program was "RSBATCH_EXECUTE_PROZESS ".
    In the source code you have the termination point in line 2874
    of the (Include) program "GPD6S3OE0BCVGC6L9DBNVYQARZM".
    The program "GPD6S3OE0BCVGC6L9DBNVYQARZM" was started as a background job.
    and when i check the dump it is point out at below code
    " Populate the lookup table for 0STOR_LOC
    SELECT * from /BI0/TSTOR_LOC
    into CORRESPONDING FIELDS OF table L_0STOR_LOC_TEXT
    FOR ALL ENTRIES IN SOURCE_PACKAGE WHERE
    STOR_LOC = SOURCE_PACKAGE-STOR_LOC.
    but the programme is syntactically correct only.
    how to rectify the issue.
    regards
    venuscm
    Edited by: venugopal vadlamudi on Sep 28, 2010 1:59 PM

    hi experts,
    We have written start routine to get the storage location text and sending to File located at Application server through OPEN HUB.
    here is the code written in the Transformations
    In the global section
    Text for 0STOR_LOC
        DATA: l_0stor_loc_text TYPE HASHED TABLE OF /bi0/tstor_loc
              WITH UNIQUE KEY stor_loc.
        DATA: l_0stor_loc_text_wa TYPE /bi0/tstor_loc.
    and in the code to get the text
    " Populate the lookup table for 0STOR_LOC
        *SELECT * from /BI0/TSTOR_LOC*
          into CORRESPONDING FIELDS OF table L_0STOR_LOC_TEXT
          FOR ALL ENTRIES IN SOURCE_PACKAGE WHERE
                  STOR_LOC = SOURCE_PACKAGE-STOR_LOC.
    im sure there is problem with the Routine only. i think i need to change the code if so please provide me the modified one.
    thanks
    venuscm
    Edited by: venugopal vadlamudi on Sep 29, 2010 9:37 AM

  • While generating reports in Oracle BI Publisher in pdf format, the generated pdf reports have hindi  इ matra displaced by one character. For example, रिपोर्ट is printed as रपेिोरट.  Word file generated of the same report have correct hindi इ  matra positi

    While generating reports in Oracle BI Publisher in pdf format, the generated pdf reports have hindi  इ matra displaced by one character. For example, रिपोर्ट is printed as रपेिोरट.  Word file generated of the same report have correct hindi इ  matra position and also pdf generated from this word file also contains the same.

  • WEB.SHOW_DOCUMENT sometimes doesn't display the generated PDF file

    Hi all,
    I'm using the following code to generated my report from Forms:<br><br>
    V_REPORT_ID := FIND_REPORT_OBJECT(V_REPORT_NAME);
    V_REPORT_SERVER_JOB:= RUN_REPORT_OBJECT(V_REPORT_ID,P_LIST);
        V_JOB_ID := substr(V_REPORT_SERVER_JOB,length(:GLOBAL.REPORTS_SERVER)+2,length(V_REPORT_SERVER_JOB));
        V_REPORT_STATUS := REPORT_OBJECT_STATUS(V_REPORT_SERVER_JOB);
    LOOP
       IF V_REPORT_STATUS = 'FINISHED' THEN          
          V_TMP_PDF := :GLOBAL.APACHE_HTML_FOLDER ||'rpt'|| V_JOB_ID  ||'.pdf' ;
         COPY_REPORT_OBJECT_OUTPUT(V_REPORT_SERVER_JOB, V_TMP_PDF );
        WEB.SHOW_DOCUMENT(:GLOBAL.AS_HOME_URL ||  'rpt'|| V_JOB_ID  ||'.pdf' ,'_BLANK');     
        END IF;
    END LOOP; <br><br>
    Everything works fine except the WEB.SHOW_DOCUMENT part. In some clients, this command does what it required from it and opens a new browser window with the PDF report displayed on it. In some other clients, this command does nothing: now window dispalyed. When I refer to the Application Server, I see the PDF report successfully generated there. When I put the URL of the generated report manually in the browser address, I can see the report.
    <br><br>
    <b>Why the WEB.SHOW_DOCUMENT doesn't display the generated PDF report in some clients?</b>

    I agree with the previous 2 posters.
    Also firefox and ie handle it differently. Make sure you test on what your clients use.
    Sometimes acrotray.exe is completely retarded and doesn't work.

  • Passing different values to the same servlet

    Hi,
    Is there a way to pass different values to the same servlet?
    Background:
    I have a database that I query to acquire a list of customers, then I show each customer as a link, that when clicked will show details of that customer. (The customer table is dynamic so I can't create a new page for each customer)
    When using JSP what I do is
    //Do query database
    while (rst.next())
         String cust = rst.getString ("cust");
            out.write("<a href = \"cust2.jsp?cust=" + cust + " \" >" + cust + "</a> ");
    }Then on the cust2.jsp. I will use
    String str = request.getParameter ("cust");to acquire the customer to get details of.
    Is there a way to do the same using servlets?
    I could swap to JSP when creating this particular part of the project but it won't look good and it would help me learn a few things when there is another way.

    I want to know if there is a way to pass a variable from a webpage link like in my JSP example using servlets.
    Here is what I wanted to do:
    I have a webpage that contains customer names and each name has a link to the same servlet (let's say the link is famia/servb). I want servb to show detailed information about the customer my visitor clicked in the webpage.
    The logic I was thinking is to pass a variable to this servlet, then I can use that variable to know which customer should I query in my database. So that I can show the details to my users.
    Here lies my problem, I don't know how I can pass this variable, or even know which customer my visitor clicked. I can't use a new servlet for each client since the customer is in a database and if my customer base grows then I would need to create a lot more web page that does the same thing.
    The JSP example I gave is how I will be coding it if I am using JSP, but now I am using servlets. So I was wodnering if there is a way to do this using servlet. Or should I stay with using JSP for this particular logic and just call servb after the JSP page acquired the variable.
    I'm trying not to use "<original URL> + ? + <variable> = <value>" (eg: http://www.famia.net/customer?cust=famia) as the means for passing the variable. (or in the example as a means of passing variable cust with value famia)

  • How do I set the initial servlet pool size in WL 5.1

              In WL 4.5, I can set the initial servlet pool size using the
              weblogic.httpd.servlet.SingleThreadedModelPoolSize. I tried to set this property in WL 5.1, and get an "Found undeclared property..." message when booting WL. Is this feature still supported in WL 5.1? If so, how do I set it?
              Thankx
              

    It appears that pool size of 5 is hardcoded somewhere - no matter where you specify
              weblogic.httpd.servlet.SingleThreadedModelPoolSize, the following test servlet:
              import javax.servlet.*;
              import javax.servlet.http.*;
              public class SingleT extends HttpServlet implements SingleThreadModel {
              static int instanceCount = 0;
              public SingleT() {
              super();
              System.out.println("Instance " + (++instanceCount) + " created");
              always produces:
              Instance 1 created
              Wed Nov 01 11:15:36 PST 2000:<I> <ServletContext-General> SingleT: init
              Instance 2 created
              Wed Nov 01 11:15:36 PST 2000:<I> <ServletContext-General> SingleT: init
              Instance 3 created
              Wed Nov 01 11:15:36 PST 2000:<I> <ServletContext-General> SingleT: init
              Instance 4 created
              Wed Nov 01 11:15:36 PST 2000:<I> <ServletContext-General> SingleT: init
              Instance 5 created
              Wed Nov 01 11:15:36 PST 2000:<I> <ServletContext-General> SingleT: init
              Joe Trung <[email protected]> wrote:
              > Hi Huy,
              > There are lot of 'undeclared' stuffes if you move from 451 to 51.
              > However, if you run WLS with
              > '-Dweblogic.httpd.servlet.SingleThreadedModelPoolSize=10'
              > You will get what you want. I think BEA has moved this option to the <System props>, no more in its <config>
              > Joe
              > "Huy Pham" <[email protected]> wrote:
              >>
              >>In WL 4.5, I can set the initial servlet pool size using the
              >>weblogic.httpd.servlet.SingleThreadedModelPoolSize. I tried to set this property in WL 5.1, and get an "Found undeclared property..." message when booting WL. Is this feature still supported in WL 5.1? If so, how do I set it?
              >>
              >>Thankx
              Dimitri
              

  • OBIEE 11g "WITH SAWITH0 AS" subquery factoring clause in the generated sql

    I've observed that the OBIEE 11g generates in the query log physical query using the WITH (sub-query factoring) clause to make the generated sql elegantly readable. This is great! Thanks for the developers. However I have some questions about this.
    __Background__
    Oracle Database' default behaviour is that if you have only one sub-query in the WITH section, it executes it as an in-line view and does not materialize it before the main sql is executed. If you have more than one, by default the database engine materializes all of them in the order of the definition. In some cases this can completely blow up the SGA and make the query never ending. To divert this behaviour you can apply two hints that work both in inline views and in sub-queries as well: /*+ MATERIALIZE */ and /*+ INLINE*/, however Analytics 11g does not seem to have hint capabilities at the logical table level, only at physical table level.
    If we go with the current defaults, developers not aware of this feature can bump into serious performance issues for the sake of some syntax candy at the generated sql level, I'm afraid.
    __Questions__
    * Is it possible to turn the Analytics server not to use WITH but use inline views instead?
    * Is there any way to sneak in some hints that would put the /*+ INLINE */ hint to the appropriate place in the generated sub-queries if needed
    * Does the Oracle Database have any initialization parameter that can influence this sub-query factoring behavior and divert from the default?

    The WITH statement is not added to make the query more elegant, it's added for performance reasons. If your queries take long to run then you may have a design issue. In a typical DWH DB SGA needs to be seriously increased since the queries ran are much larger and complex than on an OLTP DB. In any case you can disable the WITH statement in the Admin Tool by double clicking on your database object on the physical layer and going to the Features tab. The feature is called WITH_CLAUSE_SUPPORTED.

  • Inputting an excel file to the java servlet program

    Hi,
    How can I input an excel file into the java servlet program? I am using POI HSSF programming to read the content of that excel file.I have created a form that will accept the path from the user and in the servlet program, I have called a post method to retrieve the path of the file. I am getting the path of the file as a string.Then I have to access the file to read the data. But it is not working. What should I do?.Please help me.
    I have created an html file to create a form that will ask the path of the file to be loaded into the servlet program.Please give me a solution,thanks in advance. The servlet program that receives the file is shown below. It just only take the name of the file and prints if that is ok.
    <html>
    <body bgcolor="green">
    <center>
    <form method="post"  action="http://localhost:8080/examples/servlet/Ron1">
    <table>
    <tr>
    <td><B>ENTER THE PATH OF THE FILE</td>
    <td><input type=file name="path"></td>
    </tr>
    </table>
    <input type=submit value= "submit" >
    </form>
    </body>
    </html>
    import java.io.*;
    import javax.servlet.*;
    import java.lang.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.text.*;
    import java.util.*;
    import com.oreilly.servlet.MultipartRequest;
    import org.apache.poi.hssf.usermodel.*;
    public class Ron1 extends HttpServlet
       public void doPost(HttpServletRequest request, HttpServletResponse response)   throws IOException, ServletException
            response.setContentType("text/html");
            PrintWriter out = response.getWriter();
            String u = request.getParameter("FileToUpload");
            out.println("The Path is "+u);
            System.out.println("The path is "+u);
            MultipartRequest multi = new MultipartRequest(request,u,10 * 1024 * 1024);
            System.out.println("path is "+u);
            Enumeration files = multi.getFileNames();
            File fUploadedFile = null;
            String sFileName = "";
            out.println("path is "+u);
            while(files.hasMoreElements())
                            String name = (String)files.nextElement();
                            out.println("file is "+name);
                            sFileName = multi.getFilesystemName(name);
                            String type = multi.getContentType(name);
                            fUploadedFile = multi.getFile(name);
                    FileInputStream fis= new FileInputStream(fUploadedFile);
                   HSSFWorkbook wb=new HSSFWorkbook(fis);
                    System.out.println("The path is "+u);
                    out.println("File has identified successfully\n");
                    out.close();
       }

    Hi,
    Can you try to use classes from java.net package (URL, URLConnection) to pass the contents of excel file to servlet?
    HTH
    Vishal

Maybe you are looking for

  • Will an american Mac Mini work in the UK?

    My girlfriend is bringing me one home from Georgia, and I suddenly got the fear that it might not work in the UK, can anybody help me?

  • HT1498 How do I retrieve a movie that quite with 30 min to go?

    Rented a movie with Apple TV and it quite with 30 min to go.  I went to settings then to check for rentals and can't reload the movie to watch the end.  This has happened to me twice now! What do I need to do?

  • Windows Live Mail - Server unexpectedly terminates...

    Hi.  .Emails downloading fine previously then keep getting this error.  Can see 'receiving emails' in bottom right status message but only 1 appears in Inbox. Then press Send / Receive and the rest arrive in Inbox but more often duplicated. Help plea

  • Itunes vs. external hard drive..PLEASE..PLEASE help!!!! Sorry so long....

    I have over 9,000 music files in my itunes library. I hooked up an external hard drive to free up memory on my computer. I set up itunes to change the path of downloads to the new external hard drive. It worked fine until my husband forgot to turn on

  • Assign Variable in Loop

    Hi everybody, I'm writting a procedure and I want to assign to some variable, a value taken fron a cursor. I have 20 variables , and it could be more, that's why I want to do that within a loop. I tried the following: DECLARE CURSOR retrieve_salary I