Problem in jsp:forward

hi,
i have a jsp page from where i have to call my servlet.but it is mapped in xml by other name.so what should i do?can i call that servlet using named mapped into the xml.
can i do this?
<jsp:forward page="/servlet/web.xml mapping"></jsp:forward>
it's urgent.
so please help me.
kamlesh solanki

hey man,
how u doin?
your problem is quite funny. here in servlet configuration in the xml file there is what we call servlet mapping<servlet-mapping>.
here is how we map a servlet to a kind of url:
<servlet-mapping>
<servlet-name>
havet
<servlet-name>
<url-pattern>
/havva.jspa
</url-pattern>
</servlet-mapping>
nbow when calling this servlet using this url pattern it now behaves as if its in the main application directory just like where jsps are so u will forward to it like a jsp.
thats the shizzy.
ok call it like this now
<jsp:forward page="havva.jspa" />
or
<jsp:forward page="havva.jspa"></jsp:forward>
since u may be used to this style of calling the tag.
stay cool and let me know if u had any problems.

Similar Messages

  • Problem using jsp:forward in java script

    hi,
    when I use jsp forward tag inside java script i'm getting a problem that
    when the jsp is invoked it is getting forwarded to the page specified in the forward tag, without checking the if conditions. Following code may give you a better idea.
    <html>
    <script>
    function test()
    if(document.f.htemp.value=="true")
    alert("jus");
    else
    var s=document.f.htemp.value;
    alert(s);
    <jsp:forward page="success.jsp" />
    </script>
    <body>
    <form name="f" method=post>
    <input type=text name=htemp value="true">
    <input type=button onclick="test()">
    </form>
    </body>
    </html>
    please help me,thanks inadvance
    regards
    chandu

    What pgeuens means is that you can't mix javascript and jsp/java code in this way.
    ALL of the jsp/java code gets executed at the server end.
    This produces an HTML page (with embedded javascript) which gets sent to the client.
    The client then runs javascript code in response to events (onLoad, onClick, onChange etc etc)
    So in this case, the jsp:forward will always be executed, because as far as the server is concerned, the javascript is just template text.
    If you WANT to do a conditional forwarding on the server side you do it in java ie (horribly using scriptlet)
    <%
    if (testCondition){
    %>
      <jsp:forward>
    %<
    %>Or if you want to test what the client has entered client side, all you can do is submit the form, or navigate to a URL
    <script>
    function test()
    if(document.f.htemp.value=="true")
    alert("jus");
    else
    var s=document.f.htemp.value;
    alert(s);
    document.f1.action="success.jsp";
    document.f.submit();
    </script>You cannot run JSP code based on your javascript code.
    Java. Javascript. Not the same thing.
    Hope this helps,
    evnafets

  • Filter problem with jsp:forward

    Greetings,
    I was trying to implement compression filter in oc4j. Basically wrap a HttpResponseServletResponseWrapper using a GZipOutputStream for supported browsers. However whenever for eg: I have a.jsp which does jsp:forward page =b.jsp I can see in TCP monitor IllegalStateException response already committed. But I dont see any stack trace in server logs. The buffer size is 2048 and I am pretty sure it did not get filled up before the forward. I would appreciate if anybody has seen such behavior using wrapped response in OC4j(the same code works fine in tomcat and websphere). Also one thing I observed is that for every jsp:include the filter is being called (to handle this I create the wrapper if its not already there and maintain entry count into filter and decrement when I exit filter and finish gzip response when entry count become 0,which works fine). I believe that this is not a part of 2.3 spec.Even in 2.4 spec if the filter config in web.xml is not set to any value by default the filter is supposed to be in request scope. I really appreciate any pointers in resolving this

    I am pasting the stack trace for broken pipe exception. Please let me know if anybody knows the resolution. Please let me know if there is any other way to enable compression of jsp in oc4j in 9 version. The same code works in Jboss/tomacat websphere ! Also from the stack trace we can see that filter is being called for each forward and its not as per 2.3 servlet specification. Even in 2.4 by default the filter is supposed to work at request level.
    Also I have another question oc4j seems to be using hard coded value: if length is more than 100k or so it uses Transfer-Encoding chunked. Is there any clean way of disabling this behaviour for .js files? the reason is for some reason Internet explore does not cache the javascript files properly (sporadically ) when chunked response is used for javascript files.
    4/26/06 4:58 PM: com.evermind.server.http.HttpIOException: Broken pipe
    4/26/06 4:58 PM: at com.evermind.server.http.EvermindServletOutputStream.flush(EvermindServletOutputStream.java:286)
    4/26/06 4:58 PM: at java.io.FilterOutputStream.flush(FilterOutputStream.java:121)
    4/26/06 4:58 PM: at filters.gzip.GzipServletResponseStream.flush(GzipServletResponseStream.java:151)
    4/26/06 4:58 PM: at filters.gzip.GZipServletResponseWrapper.flushBuffer(GZipServletResponseWrapper.java:127)
    4/26/06 4:58 PM: at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:244)
    4/26/06 4:58 PM: at com.evermind.server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:189)
    4/26/06 4:58 PM: at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:199)
    4/26/06 4:58 PM: at SecondPage.jspService(_SecondPage.java:83)
    4/26/06 4:58 PM: at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    4/26/06 4:58 PM: at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    4/26/06 4:58 PM: at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    4/26/06 4:58 PM: at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    4/26/06 4:58 PM: at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    4/26/06 4:58 PM: at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    4/26/06 4:58 PM: at filters.CookieFilter.processRequest(CookieFilter.java:522)
    4/26/06 4:58 PM: at filters.CookieFilter.validateRequest(CookieFilter.java:127)
    4/26/06 4:58 PM: at filters.CookieFilter.doFilter(CookieFilter.java:51)
    4/26/06 4:58 PM: at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
    4/26/06 4:58 PM: at filters.gzip.GZipFilter.doFilter(GZipFilter.java:176)
    4/26/06 4:58 PM: at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
    4/26/06 4:58 PM: at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    4/26/06 4:58 PM: at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:240)
    4/26/06 4:58 PM: at com.evermind.server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:189)
    4/26/06 4:58 PM: at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:199)
    4/26/06 4:58 PM: at FirstPage.jspService(_FirstPage.java:131)
    4/26/06 4:58 PM: at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    4/26/06 4:58 PM: at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    4/26/06 4:58 PM: at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    4/26/06 4:58 PM: at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    4/26/06 4:58 PM: at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    4/26/06 4:58 PM: at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    4/26/06 4:58 PM: at filters.CookieFilter.processRequest(CookieFilter.java:522)
    4/26/06 4:58 PM: at filters.CookieFilter.validateRequest(CookieFilter.java:127)
    4/26/06 4:58 PM: at filters.CookieFilter.doFilter(CookieFilter.java:51)
    4/26/06 4:58 PM: at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
    4/26/06 4:58 PM: at filters.gzip.GZipFilter.doFilter(GZipFilter.java:176)
    4/26/06 4:58 PM: at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:556)
    4/26/06 4:58 PM: at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    4/26/06 4:58 PM: at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
    4/26/06 4:58 PM: at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
    4/26/06 4:58 PM: at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
    4/26/06 4:58 PM: at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
    4/26/06 4:58 PM: at java.lang.Thread.run(Thread.java:479)

  • jsp:forward ... tag in servlet doesn't work in 7.0

              I have a problem with <jsp:forward ... > command.
              I found a post in the newsgroups that this is a bug traced by
              CR078071 and I am stucked because of this problem. Please, send me a patch.
              

              I have a problem with <jsp:forward ... > command.
              I found a post in the newsgroups that this is a bug traced by
              CR078071 and I am stucked because of this problem. Please, send me a patch.
              

  • Jsp:forward URL problem

    Hi,
    I have 2 pages X.jsp and Y.jsp
    The content of X.jsp is a simple
    // send an email here
    <jsp:forward page="Y.jsp">
    </jsp:forward>
    The content of Y.jsp is only "Mail is sent" message.
    The problem is that everytime page X is loaded,
    the browser displays Y.jsp content, but the URL in the Address box of the browser still displays X.jsp
    This leads me to reload problem, even though the page displays the "Mail is sent" message, the URL still shows X.jsp, and everytime the browser is reloaded, another mail is sent.
    How to make the URL change to Y.jsp ?
    TIA.

    Hi,
    I have 2 pages X.jsp and Y.jsp
    The content of X.jsp is a simple
    // send an email here
    <jsp:forward page="Y.jsp">
    </jsp:forward>
    The content of Y.jsp is only "Mail is sent" message.
    The problem is that everytime page X is loaded,
    the browser displays Y.jsp content, but the URL in the
    Address box of the browser still displays X.jsp
    This leads me to reload problem, even though the page
    displays the "Mail is sent" message, the URL still
    shows X.jsp, and everytime the browser is reloaded,
    another mail is sent.
    How to make the URL change to Y.jsp ?
    TIA.Thats the natural behavious of forward.
    One simple solution is not to use forward. You can use HTTP redirection rather than forward.
    Hope it helps.

  • Jsp forward problem, I think.....

    I have a default.htm page that takes in a feild, EMP_NUM. Once the user
              hits the Submit button, I run a select statement(select.jsp) to see if that
              number exists. If it does then I forward the contents to correct.jsp, if the
              number doesn't exist then I forward to failed.jsp.
              Today is Tuesday, and last Friday I was working on this and everything
              worked fine, in fact perfect. I came in this morning to do some more
              testing, specifically catching errors in my try and catch, example - to make
              sure they enter in a number, and after I type in a number and hit the submit
              button, it trys to go to the next page, but displays nothing, the page is
              blank. Where has before, when everything was working fine on Friday, my
              correct.jsp page or my failed.jsp page would be displayed.
              From Friday to Tuesday I had not made any changes to my files. The only
              thing different, that I can think of, would be that on Friday I would have
              stoppped weblogic and this morning I started weblogic again. This is why I
              think this is a weblogic issue or syntax on my part. I have tried to restart
              my computer, restart weblogic, and I even deleted the .java files that
              weblogic creates and places in the weblogic/myserver/classfiles/jsp_servlets
              folder.
              Below is my source code.
              Please help!
              Thanks, jl.
              <% try {
              <%@ include file = "db_conn.jsp"%>
              <%
              // A Statement object is what sends your SQL statement to the db
              Statement stmt = conn.createStatement();
              // Retrieve the user id number from the previous form.
              int EMP_NUM = Integer.parseInt(request.getParameter("EMP_NUM"));
              //SQL prepared statement
              String selectEMP_NUM = "SELECT NAME, COMPANY_KEY FROM WTS_PROFILE WHERE
              EMP_NUM=?";
              PreparedStatement psEMP_NUM = conn.prepareStatement(selectEMP_NUM);
              psEMP_NUM.setInt(1, EMP_NUM);
              ResultSet rsEMP_NUM = psEMP_NUM.executeQuery();
              String NAME = "";
              int CompanyKey = 0;
              while (rsEMP_NUM.next()) {
              NAME = rsEMP_NUM.getString("NAME");
              CompanyKey = rsEMP_NUM.getInt("COMPANY_KEY");
              }// end of while
              psEMP_NUM.clearParameters();
              psEMP_NUM.close();
              conn.close();
              String sEMP_NUM = Integer.toString(EMP_NUM);
              String sCompanyKey = Integer.toString(CompanyKey);
              if (NAME.equals("")) {
              request.setAttribute("EMP_NUM", sEMP_NUM);%>
              <jsp:forward page="failed.jsp">
              <% }// end of if
              else {
              request.setAttribute("NAME", NAME);
              request.setAttribute("EMP_NUM", sEMP_NUM);
              request.setAttribute("CompanyKey", sCompanyKey);%>
              <jsp:forward page="creditcard.jsp">
              <% }// end of else
              }// end of try1
              catch(Exception e) {
              <% if(e.toString().equals("java.lang.NumberFormatException: ")) { %>
              <font face="Arial" size="2" color="red"><center><strong>Please enter in a
              EMPLOYEE ID NUMBER.<br><br></strong></font></CENTER>
              <%}// end of if
              %>
              </TD></TR></TABLE></DIV>
              <font color="red">"<%=e.toString()%>"</font>
              <%
              }// end of catch1
              %>
              

              Sounds like you have some debugging to do. If you didn't reinstall WLS and it worked fine before,
              then I doubt it is a WLS problem.
              Is your page really blank? Try show source in your browser? I think you have some mismatched
              <table> </table>. Try it in both IE and Netscape - one of them forgives you for mismatched table
              tags.
              Add some System.out.println() in your code to see what is being executed.
              "james lorenzen" <[email protected]> wrote:
              > I have a default.htm page that takes in a feild, EMP_NUM. Once the user
              >hits the Submit button, I run a select statement(select.jsp) to see if that
              >number exists. If it does then I forward the contents to correct.jsp, if the
              >number doesn't exist then I forward to failed.jsp.
              > Today is Tuesday, and last Friday I was working on this and everything
              >worked fine, in fact perfect. I came in this morning to do some more
              >testing, specifically catching errors in my try and catch, example - to make
              >sure they enter in a number, and after I type in a number and hit the submit
              >button, it trys to go to the next page, but displays nothing, the page is
              >blank. Where has before, when everything was working fine on Friday, my
              >correct.jsp page or my failed.jsp page would be displayed.
              > From Friday to Tuesday I had not made any changes to my files. The only
              >thing different, that I can think of, would be that on Friday I would have
              >stoppped weblogic and this morning I started weblogic again. This is why I
              >think this is a weblogic issue or syntax on my part. I have tried to restart
              >my computer, restart weblogic, and I even deleted the .java files that
              >weblogic creates and places in the weblogic/myserver/classfiles/jsp_servlets
              >folder.
              >
              >Below is my source code.
              >Please help!
              >Thanks, jl.
              >
              ><% try {
              > <%@ include file = "db_conn.jsp"%>
              ><%
              > // A Statement object is what sends your SQL statement to the db
              > Statement stmt = conn.createStatement();
              >
              > // Retrieve the user id number from the previous form.
              > int EMP_NUM = Integer.parseInt(request.getParameter("EMP_NUM"));
              >
              > //SQL prepared statement
              > String selectEMP_NUM = "SELECT NAME, COMPANY_KEY FROM WTS_PROFILE WHERE
              >EMP_NUM=?";
              > PreparedStatement psEMP_NUM = conn.prepareStatement(selectEMP_NUM);
              > psEMP_NUM.setInt(1, EMP_NUM);
              >
              > ResultSet rsEMP_NUM = psEMP_NUM.executeQuery();
              >
              > String NAME = "";
              > int CompanyKey = 0;
              > while (rsEMP_NUM.next()) {
              > NAME = rsEMP_NUM.getString("NAME");
              > CompanyKey = rsEMP_NUM.getInt("COMPANY_KEY");
              > }// end of while
              >
              > psEMP_NUM.clearParameters();
              > psEMP_NUM.close();
              > conn.close();
              >
              > String sEMP_NUM = Integer.toString(EMP_NUM);
              > String sCompanyKey = Integer.toString(CompanyKey);
              > if (NAME.equals("")) {
              > request.setAttribute("EMP_NUM", sEMP_NUM);%>
              > <jsp:forward page="failed.jsp">
              ><% }// end of if
              > else {
              > request.setAttribute("NAME", NAME);
              > request.setAttribute("EMP_NUM", sEMP_NUM);
              > request.setAttribute("CompanyKey", sCompanyKey);%>
              > <jsp:forward page="creditcard.jsp">
              ><% }// end of else
              >}// end of try1
              >catch(Exception e) {
              ><% if(e.toString().equals("java.lang.NumberFormatException: ")) { %>
              > <font face="Arial" size="2" color="red"><center><strong>Please enter in a
              >EMPLOYEE ID NUMBER.<br><br></strong></font></CENTER>
              ><%}// end of if
              >%>
              > </TD></TR></TABLE></DIV>
              > <font color="red">"<%=e.toString()%>"</font>
              ><%
              >}// end of catch1
              >%>
              >
              >
              

  • Jsp:forward problem, help appreciated

    hi all,
    The following piece of code from a jsp page is giving the following error
    "java.lang.IllegalStateException: Error: Attempt to clear a buffer that's already been flushed".
    updateToCompAccount is a button on the previous page
    <%
    if(request.getParameter("updateToCompAccount")!=null){
    %>
    <jsp:forward page="UpdateToCompAccount.jhtml" />
    <% } %>
    here is the stack trace:
    java.lang.IllegalStateException: Error: Attempt to clear a buffer that's already been flushed
    at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:376)
    at org.apache.jsp.adminUserProfileUpdate_jhtml._jspService(adminUserProfileUpdate_jhtml.java:474)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
    at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:409)
    at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:528)
    at java.lang.Thread.run(Thread.java:595)
    Anybody have any ideas?
    Thanks.

    Well, the simplest way to do this would be:
    public class MyClass extends HttpServlet {
      public void doGet(HttpServletRequest request, HttpServletResponse response) {
           String buttonName = request.getParameter("myButtonRequestVariable");
           if ("update".equals(buttonName)) {
               request.getRequestDispatcher("UpdateToCompAccount.jhtml").
                             forward(request, response)
             } else if ("delete".equals(buttonName)) {
                  request.getRequestDispatcher("DeleteCompAccount.jhtml").
                            forward(request, response)
             } else {
                  request.getRequestDispatcher("ErrorPage.jhtml").
                      forward(request, response)
      public void doPost(HttpServletRequest request,
    } But that can get unwieldy if you've loads of buttons. Have you studied the concept of Model View Controller (MVC)?

  • Urgent Solution needed--Problem in JSP compilation with JDK 1.5 and JDK 1.6

    Hi,
    I m using JDK 1.5 and Tomcat 5.0 the problem is that after starting server when I m going to access my application at that time instead of displaying HomePage it directly display the blank page on screen.
    After analyzing tomcat log I have found that there was a problem with JSP page compilation.
    The exception logged in Tomcat Log is given below
    An error occurred at line: 1 in the generated java file
    The type Collection is not generic; it cannot be parameterized with arguments <? extends E>
    Stacktrace:
    *     at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)*
    *     at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)*
    *     at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)*
    *     at org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)*
    *     at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)*
    *     at org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)*
    *     at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)*
    *     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)*
    *     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)*
    *     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)*
    *     at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)*
    *     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)*
    *     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)*
    *     at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)*
    *     at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:447)*
    *     at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)*
    *     at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)*
    *     at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:424)*
    *     at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:343)*
    *     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)*
    *     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)*
    *     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)*
    *     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)*
    *     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)*
    *     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)*
    *     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)*
    *     at java.lang.Thread.run(Thread.java:619)*
    After getting this kind of error I have analyzed my code furhter then I came to know that there was problem with static include tag.
    In my jsp page I have used following line which is the main cause of error
    <%@ include file="top.jsp" %>If I ommit this line then it is working properly.
    Instead of static include I have used jsp:include also.
    Still I m getting same problem.
    We have to migrated from JDK 1.5 to 1.6 and Tomcat 5.0.28 to 6.0.14, still same problem is there.
    We have tried a lot but didnt get success to overcome this problem.
    If anybody having any solution then ur each reply will be appreciated.
    Thanks in advance..........!!!!!!!
    Edited by: JBOSS2000 on Jan 15, 2008 9:29 AM

    Hi "mshanu" and "amit" Thanks for ur replies Here I m posting the code of "top.jsp"........!!!!
    <%@ page errorPage="errordisplay.jsp"%>
    <table cellpadding="0"
           cellspacing="0"  height=50 width=780>
           <tbody>
             <tr class="header">
               <td class="logo"><IMG SRC="assets/Logo.gif" BORDER=0 ALIGN=top></td>
               <td align="right"><span class="applicationtitle"><%@ include file="/contents/logo.htm" %></span><br>
               <span class="companyname"><%@ include file="/contents/companyname.htm" %></span></td>
             </tr>
            </tbody>
    </table>To include top.jsp I have tried
    <jsp:include page="top.jsp" flush="true">
    </jsp:include>
             AND       
    <%@ include file="top.jsp"%>but none of this worked.
    If I remove the include then It is working properly.
    But I need inluded file too so that I am wondoring for the solution.
    This problem seems very wiered to me. I dont know why it is happening.
    This problem is started only when I used the TOMCAT 6.14.
    Is it the bug of TOMCAT 6.14 or What somebody Plz help.
    I got stuck here.........!!!!!!!!!!
    It doesn't seem any problem with top.jsp. As per my thinking the problem is there in include due to that it doesn't compile the JSP page in Tomcat 6.0.
    Earlier I am having same code running on the Tomcat 5.0.28 and JDK 1.5.0.
    But problem occured when I have used Tomcat 6.x...!!

  • JSP forward issue

    I have a web application deployed on weblogic 8 server. I have a jsp (AddNewUser.jsp) which forwards to a servlet (CreateUserServlet.class) with the following code :
    <jsp:forward page="/admin/CreateUser?userID=new"/>In the CreateUserServlet class, I have overriden init(config) as follows:
    public void init(ServletConfig config)throws ServletException {
             super.init(config);
            context = config.getServletContext();
    }In the doPost method, I have some debug statements as follows:
    public void doPost(HttpServletRequest request, HttpServletResponse response) {
    System.err.println("--------CreateUserServlet start------- ");
    //initialization code here    
    context.getRequestDispatcher("/WEB-INF/jsps/admin/createUser.jsp").forward(request, response);
    }The flow of actions is :
    1. User clicks on a link to AddNew.jsp which forwards to the CreateUserServlet
    2. The servlet performs some initialization (not shown) and forwards to createUser.jsp page
    3. The createUser.jsp page contains a form which the user fills and clicks "save".
    4. The form calls another servlet which saves the new user to the database.
    The problem now which I have is that the web application works perfectly on 4-5 test machines except for the client ( what luck huh?). For him this is what happens
    1. He clicks on a link to AddNew.jsp, he gets forwarded to the createUser.jsp page (as expected..no problem here!)
    2. He enters some data and clicks "save" and the new user gets saved to the database.(as expected..no problem here!)
    3. Now, when he tries repeating by clicking on the link to AddNew.jsp page, the debug statement "--------CreateUserServlet start------- " does not get printed to the console!!(HERE IS THE PROBLEM!) but he still gets forwarded to the createUser.jsp page! This is creating a problem because my initialization code is being skipped.
    So, the client is able to enter a new user the first time he visits the section but is not able to add thereafter.
    Any clues please?

    I wonder if what is happening is when he clicks the link to AddNew.jsp teh browser is pulling the page out of cache. That would explain why he gets the CreateUser form without hitting the CreateUserServlet.
    It is easy enough to check by enabling the access logs for your server. Then when he clicks on the link check the log to see if the request was recieved on the server and teh responce code is 304
    If it is a caching problem there are pleanty of examples of the HTML meta data tags to prevent cahcing on the forum if you search for them.

  • How to make browser aware of new URL after JSP:forward

    When I use JSP:forward (or pageContext.forward() for that matter) to forward from a.jsp to b.jsp, the browser still seems to think he's at a.jsp. Assumably because the request for the new URL didn't originate with the browser. This causes problems when I try to use relative URL's in b.jsp (the forwarded URL) since the client kindly tries to resolve them for me using the wrong base URL.
    For example:
    I log in at <mysite>/Security/login.jsp.
    Here, I do some login magic and then forward to /Accounts/index.jsp.
    The state of the browser is now:
    a) the URL is <mysite>/Security/login.jsp
    b) the page displayed is <mysite>/Accounts/index.jsp
    Is there a better mechanism I can use to keep browser URL and displayed page synched up?
    BTW, in this simplified example I could use JavaScript history.go(-1) to let the browser do the forwarding itself. This won't work in my actual scenario because I actually forward to a page stored in the session several requests back.
    Any help would be very much appreciated!
    Andy

    Assumably because the request for the new URL didn't originate with >the browserThis is correct.
    One way for the browser to show the URL is by using a sendRedirect() after doing all the necessary processing. But you will loose all request attributes during a sendRedirect(). To overcome this, after you have done all processing and are ready to process the accounts jsp, you can put the required info in the session. The accounts jsp can get the info from the session instead of from the request, and then reset these in the session to prevent further use.

  • Qns about jsp:include and jsp:forward

    It is said that <jsp:include>'s flush is only fixed to "true". Which means the page cannot pass its full control to another page using <jsp:forward> tag.
    Is there any ways to overcome this problem? Using both in the same jsp and allow it to passes full control.

    Hmm.. I'm using the form action to call back the jsp itself to validate something, and the include to add in another jsp file together with the original jsp to produce some addon visual effects.
    So saying if validate is true, forward to another jsp.
    So the form action.. cannot be use I think.

  • Weird behaviour with jsp:forward and jsp:param

    I'm running Orion 1.5.3
    Wanted to ask if anyone has insight into the following.
    I'm trying to do a forward with a parameter. The parameter is something like a message string.
    The following does not work.
    <%
    String result = "unsucessful"; // retrieved from external source... hardcoded for example's sake
    %>
    <jsp:forward page="<%=nextPage%>">
    <jsp:param name="message" value="The result was <%=result%>"/>
    </jsp:forward>
    I've managed to deduce that the error is in the param value. Apparently, we cannot mix variables with static values inside the value parameter.
    I've managed to get it working by doing this...
    <%
    String result = "unsucessful"; // retrieved from external source... hardcoded for example's sake
    String message = "The result was " + result;
    %>
    <jsp:forward page="<%=nextPage%>">
    <jsp:param name="message" value="<%=message%>"/>
    </jsp:forward>
    My question is, is this a bug or is it supposed to be this way ? Can we mix the value parameters ?

    Hi Bernard,
    Take a note of the following syntax -
    <jsp:forward page={"relativeURL" | "<%= expression %>"} >
    <jsp:param name="parameterName"
    value="{parameterValue | <%= expression %>}" />+
    </jsp:forward>
    It is evident that either the value attribute can have an expression or simple text.
    I have tried your example and I am also encountering the same kind of problem, but I have found a way out.
    You can try the following in your code -
    <%
    String result = "unsucessful"; // retrieved from external source... hardcoded for example's sake
    %>
    <jsp:forward page="<%=nextPage%>">
    <jsp:param name="message" value=' <%= "The result was" + result%>'/>
    </jsp:forward>
    Instead of using
    value= "The result was <%=result%>" you can use
    value= '<%= "The result was" + result%>'.
    Hope this helps

  • Calling jsp:forward on clicking a link

    Hi, I need to forward to another JSP (needs to be the same request object) when the user clicks on a link. Is there any way can do this? If I have a JavaScript function with the jsp:forward and call the function on clicking the link (href), the jsp:forward gets executed the very first time the page is displayed.
    Any suggestions are greatly appreciated.
    Thanks
    SP

    Thank you.. I was hoping there would be some way to forward on click of a link :-( I do not want to use the session option since I am using a bean in request scope. Let me explain my problem in more detail:
    The scenario is like this - There is a JSP page, page A that has a form. Here the user enters some data that he wants to upload to a site. On clicking submit, page A does some validations and forwards to page B. Page B has a link, on clicking this, the user can preview the uploaded data. If he does not like what he sees, page B has a Return link. This should take him back to page A with all the data he entered intact. I am using a Bean that has all the form values, and it is in request scope, so I need to be able to forward to Page A on clicking the return link/button. Scope session is not ok, since I do not want the form data to be valid for the entire browser session only for the request.
    Any thoughts, anyone?

  • Jsp:forward explained ?

    Here the dir structure of my authentification module :
    /admins/login.jsp
    /admins/centralAdmin.jsp (lists all Admins)
    /admins/players/ADMPlayers.jsp
    /admins/news/ADMNews.jsp
    /templates/mystyle.css
    In my site authentification, I need to redirect people to login.jsp if they access the admin urls directly without passing by the login page.
    I have tried something like bellow in these pages
    centralAdmin.jsp:
    <% if (session.session.getAttribute("LOGGED") == null){%>
    <jsp:forward page="/admins/login.jsp"/>
    <%}
    %>
    <link rel="stylesheet" type="text/css" href="../templates/mystyle.css">
    OK
    For page like /admins/players/ADMPlayers.jsp, it redirects me to login.jsp but the css in the login file (like the above) can't be reached. It will if I use
    <link rel="stylesheet" type="text/css" href="../../templates/mystyle.css">
    instead ????
    The main goal is to put the test login file in a include file.
    I have tried to set the path to /templates/mystyle.css in the link but it doesn't work.
    Anyone can help ?

    The problem is that your web browser thinks you are at (for instance) "/admins/players/ADMPlayers.jsp", but your CSS is located in "/templates/mystyle.css". So, "../templates/mystyle.css" being called from "/admins/players/ADMPlayers.jsp" will look for "/admins/templates/mystyle.css" which does not exist. That is the reason why using "../../templates/mystyle.css" does work. What is it that you are trying to do exactly? just be able to reference the CSS? Have you tried putting in the WHOLE URL instead of just the relative URL?

  • "&" character not being sent in parameter value string with jsp:forward

    String _url =
              "controller.jsp?_page="+nextPage+"&amp_count="+sessionManager.getCounter();
              <jsp:forward page="<%= (String) pageMap.get(nextPage) %>">
              <jsp:param name="_url" value="<%= _url %>"/>
              </jsp:forward>
              Receiving page:
              <% String url = request.getParameter("url");
              application.log("\n\t[skybook:home]_url = " + _url);
              %>
              Log:
              [skybook:home]_url = controller.jsp?_page=home
              If I remove the "&" from _url, then the rest of the string will appear.
              Anyone ever seen this?
              Thanks!
              

    I'm having a similar problem where I cannot even get the params to show up in the forwarded page.
              

Maybe you are looking for

  • Any way to make text larger in Photoshop CS 5 Extended?

    I recently upgraded from CS3 and the tool labeling text is too small to be able to see on the toolbars. The icons seem smaller too. I need to use a magnifying glass now and didn't need to do that with CS3. I did look through Photoshop's prefs (the ma

  • Im trying to download my product but im having difficulty

    im trying to download the student complete package which ive purchased, it takes me to a page which says downloading but its not actually downloading. please help

  • How to create a faster function?

    Dear all,  I am trying to create function which can replace certain words with hyperlink in sql. When I call the function as query in sql, its takes a very long time to execute the query, more than 2-3min. I assumed this is because, the tag_libary ta

  • Hung WebLogic Server in Adobe LiveCycle ES Update 1 (8.2.1)

    Hi. Please feel free to move this post to a better forum if it doesn't belong in the WebLogic install forum. I'm posting my findings to help the end user communty and Adobe support staff, so they can better assist users.  I hope the information helps

  • Database Datafiles Recovery. ORA-01219: database not open:

    Hi, I have a 10g database running on SuSE Linux server. I mistakenly deleted one of my file system's files that contain some of the database datafiles. I can connect to the database but I am failing to run queries: SQL> select * from global_name; sel