Servlet to JSP forward issue

I'm currently developing an app where I use a servlet as the controller and it forwards everything to a jsp for viewing. When I run the jsp as a standalone everything works fine, all of my javascript and css code. When I forward to it, all of my javascript code and css gets lost. Has anyone seen anything like this or have an explanation? Any help would be appreciated.
Thanks,
Mike

Have you tried a different brower or view its textual response with telnet? there are some restricitons regarding servlet outputstream when forward is used (see Servlet spec 2.4 Section SVR.8.4, JSP Spec 2.0 section JSP.5.5). Any server log and stack trace and testcase will be helpful.

Similar Messages

  • 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.

  • Accessing Servlet by jsp: forward

    I want to access Servelt by hyperlink in a jsp web site
    connection.jsp
    <%@ page contentType="text/html;charset=GB2312" %>
    <HTML>
    <BODY bgcolor=cyan><Font size=1>
    <A Href="/myjsp/Hello" >Accessing servlet<A>
    </BODY>
    </HTMLi put the bean in the dir(/myjsp/WEB-INF/classes/hello(package)/Hello)
    and modify the file web.xml like this:
    <servlet>
            <servlet-name>Hello</servlet-name>
            <servlet-class>hello.Hello</servlet-class>
        </servlet>
        <servlet-mapping>
           <servlet-name>Hello</servlet-name>
           <url-pattern>/Hello</url-pattern>
        </servlet-mapping>it works!
    but if i use <jsp:forward>
    <html>
         <body bgcolor="green">
         <jsp:forward page="/myjsp/Hello" />
         <body>
    </html>it causes an Exception The requested resource (/myjsp/myjsp/SimpleServlet) is not available.
    why? why the path have /myjsp/myjsp....?
    Thanks

    only one wrong u have done that is
    U have to give :
    <jsp:forward page="/Hello"></jsp:forward>
    but not
    <jsp:forward page="/myjsp/Hello"></jsp:forward>
    the reason is that when u run a jsp file , a servlet is generated for that
    jsp file. so calling a another servlet from that servlet(servlet of connection.jsp) can be done by just giving url -pattern. No need to give
    /myjsp/Hello .
    regards,
    reply after u get

  • Iplanet/Servlet Forwarding Issue/Question

    Scenario:
    A directory is protected using Iplanet web server access control (Iplanet Directory Server). User accesses the directory and enters valid user name and password. User is authenticated OK. The file is then posted to a servlet which does a forward to another page in the same directory. The page is not displayed due to a problem with authentication. Code to forward is as follows:
    getServletConfig().getServletContext().getRequestDispatcher(response.encodeURL(pageName)).forward(request,response);
    I check request.getUserPrincipal().getName() and
    request.getRemoteUser(). The first returns the username that iWS is running under, the second returns
    null. Is there a correct way of doing this to avoid the forward from failing.

    requiem wrote:
    Question to BT
    Hello i have recently joined BT Infinity and have hit the issue of the Port Forwarding not working. My HH3 is on the following version of software. Will this version automatically upgrade to the latest version of firmware and will this fix my port forwarding issue?.........
    Thank you
    Dean.
    Current firmware:
    V100R001C01B031SP09_L_B
    Last updated:
    Unknown
    Hi Dean
    By the look of it you've got the type B version of the HH3 with current firmware.
    From http://bt.custhelp.com/app/answers/detail/a_id/13073
    The latest versions of the firmware are:
    BT Home Hub 3 – Software version 4.7.5.1.83.8.57.1.3 (Type A) or V100R001C01B031SP09_L_B
    Please Click On any Text in Blue as that automatically links to information.
    PC (NDEGR)

  • 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.
              

  • Servlet and JSP combination and design issue

    My task is to generate the list box dynamically based on the input XML file.
    I create a JSP page and a servlet.
    http://www.myserver.com/page1.jsp
    In page1.jsp, I have the following to call servlet from JSP page
    <jsp:include page="myproj.TableGeneration"/>
    In my case, I think I don't need servlet at all, but just Java Bean
    class to generate the table. And JSP page call that Java Bean class.
    But in what situation we need the combination of servlet and JSP?
    What do you think? Any ideas? Thanks!

    Trying to keep the data separate from the view is always a good idea
    I have used XML in a similar way - the XML is the data, this is read and it is uses to populate various page beans - the beans are then simply used in the JSP page to get the information only

  • Clarification of Servlet Spec for forwarding and filters

    Hi everybody,
    I'm having a problem trying to use SiteMesh in WebLogic 9.1 vs Tomcat 5.5.17. The issue seems to come up because the two containers have different behavior when it comes to forwarding and filters.
    The scenario is this: A request comes in to a servlet, that servlet forwards to a JSP page using RequestDispatcher.forward(). The SiteMesh filter looks at request.getServletPath() after the chain has executed and determines whether or not to apply the decoration based on the path of the page. The filter's doFilter() method looks something like :
    chain.doFilter(request, response)
    if(request.getServletPath() = matchingPath)
        applyDecoration();
    }Now, in Tomcat, a call to request.getServletPath() before and after the call to chain.doFilter() returns the exact same thing, regardless of whether the target servlet executes a forward. But in WebLogic, the call to getServletPath() after chain.doFilter() returns the forwarded path, not the original path.
    Who is right? Or is this one of those gray areas?
    Thanks,
    Scott

    Thanks for the info. You are correct, I was using 'forward'. I changed it to use 'sendRedirect' and this time the request goes via the filter. However, the request parameters that were in the original request have disappeared after the 'sendRedirect'. I could just add all the request parameters to the string I pass to sendredirect but was wondering if there was a better/simpler way.
    Thanks,
    Paul

  • Passing value from Servlet to JSP back to Servlet

    Hi all,
    I have a jsp page where a user submits a search string into a text box. The jsp forwards to a servlet which calls some java classes and checks a database. The classes generate a string which contains some html. The servlet then forwards back to the jsp which displays the the string:
    <c:out escapeXml="false" value="${requestScope.ampList}" />The user then performs another action on this outputted html which is a listbox and when the user clicks on the listbox the onchange method submits the form. The JSP forwards the listbox value and I would like it to forward the "ampList" as well but I cant figure out how to do this.
    Using a hidden input does not work because the string contains HTML. Does anyone have any ideas. I can just keep the search string stored a hidden input box but I would prefer not to regenerate the "ampList" as it means accessing the database again which will cause performance issues.
    Thanks for any input in advance,
    Tom

    Ha,
    Writing that message gave me an idea which worked:
    <input type="hidden" name="ampList" value="<c:out escapeXml="true" value="${requestScope.ampList}" />" />

  • AppMod pooling with Servlets and JSPs

    Issue:
    I have a servlet that I need to do some work on a BC4J View Object (myVO), like set the where clause, execute, etc. I want to perform these actions in the servlet, and then forward on to a .jsp page (mypage.jsp). Then I want to use the BC4J Data Tag library to present the data. Normally, the AppMod tag would be used to get ahold of an AppMod, but in my case, I want to use the specific AppMod that I prepared inside the servlet that forwarded to mypage.jsp.
    I have looked through the BC4J Data Tag library and it appears that the data tags are getting the AppMod from the page context. I looked at the AppMod tag and I couldn't see exactly where it was sticking the AppMod into the page context, but when I looked at the DataSource tag, it was retrieving the AppMod from the page context. Therefore, I am assuming the AppMod tag is sticking it into the page context.
    What I would like to be able to do is perform some work on the AppMod in my servlet, then forward to a .jsp. Once in the .jsp, I would like to reference the AppMod without having to use the AppMod tag, but reference the AppMod directly from the DataSource tag. This would allow me to completely manage the AppMod interaction in my servlet, thus centralizing that logic and avoiding multiple check-ins/check-outs of the AppMod. I could also avoid using stateful management of the AppMod.
    Any insights would be much appreciated!
    Thx,
    Eric

    Core Servlets is pretty good. I have both parts.
    One day I'm actually going to read them.you mean these two right?
    Core Servlets and Javaserver Pages: Core Technologies, Vol. 2 (2nd Edition) (Core) by Marty Hall, Larry Brown, and Yaakov Chaikin
    Core Servlets and JavaServer Pages, Vol. 1: Core Technologies, Second Edition by Marty Hall and Larry Brown
    I should buy the Vol 1 first right?

  • Pass data from servlet to jsp using sendRedirect

    Hi,
    I am passing data from servlet to jsp using forward method of request dispatcher but as it doesn't change the url it is creating problems. When ever user refreshes the screen(browser refresh) it's re-loading both servlet and jsp, which i don't want to happen. I want only the jsp to be reloaded.
    Can I pass data from servlet to jsp using sendRedirect in this case. I also want to pass some values from servlet to jsp but without using query string. I want to set some attributes and send to jsp just like we do for forward method of request dispatcher.
    Is there any way i can send data using attributes(without using query string) using sendRedirect? Please let me know

    sendRedirect is meant as a true redirect. meaning
    you can use it to redirect to urls not in your
    context....with forward you couldn't pass information
    to jsps/servlets outside your own context.Actually, you can:
    getServletContext().getContext("/other").getRequestDispatcher("/path/to/servlet").forward(request, response)I think the issue here is that the OP would like to have RequestDispatcher.forward() also update the address in the client's browser. That's not possible, AFAIK. By the time the request is forwarded, the browser has already determined the URL of the servlet, and the only I know of way to have the browser change the URL to the forwarded Servlet/JSP is to send a Location: header (i.e. sendRedirect()). Remember that server-side dispatching is transparent to the client. Maybe there's some tricky stuff you can do with JavaScript to change the address in the address bar without reloading the page?
    Brian

  • 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)

  • Is the jsp forward tag fails in iplanet application server sp2?

    11/Feb/2002 17:55:41:2] error: Exception: SERVLET-compile_failed: Failed in compiling template: /EinsWebTool/QueryScreen.jsp, Parse error in JSP parser. Missing endtag: /jsp:forward
    Exception Stack Trace:
    java.lang.Exception: Parse error in JSP parser. Missing endtag: /jsp:forward
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at com.netscape.jsp.JSP.parseBlock(Compiled Code)
    at com.netscape.jsp.JSP.parseReqDisp(Unknown Source)
    at com.netscape.jsp.JSP.parseTag(Compiled Code)
    at com.netscape.jsp.JSP.parseNext(Compiled Code)
    at com.netscape.jsp.JSP.parseBlock(Compiled Code)
    at com.netscape.jsp.JSP.parse(Unknown Source)
    at com.netscape.jsp.JSP.compile(Unknown Source)
    at com.netscape.server.servlet.jsp.JSPCompiler.JSPtoJava(Unknown Source)
    at com.netscape.server.servlet.jsp.JSPCompiler.compileJSP(Compiled Code)
    at com.netscape.server.servlet.jsp.JSPCompiler.compileOrLoadJSP(Unknown Source)
    at com.netscape.server.servlet.jsp.JSPCompiler.compileInstance(Unknown Source)
    at com.netscape.server.servlet.jsp.JSPCompiler.compileInstance(Unknown Source)
    at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse.callJspCompiler(Unknown Source)
    at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse.callUri(Unknown Source)
    at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse.callUriRestrictOutput(Unknown Source)
    at com.netscape.server.servlet.platformhttp.PlatformRequestDispatcher.forward(Unknown Source)
    at com.netscape.jsp.PageContextImpl.forward(Unknown Source)
    at jsp.APPS.EinsWebTool.Login._jspService(Compiled Code)
    at jsp.APPS.EinsWebTool.Login.service(Login.java:42)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown Source)
    at com.netscape.server.servlet.servletrunner.ServletRunner.callJSP(Unknown Source)
    at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse.callJspCompiler(Unknown Source)
    at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse.callUri(Unknown Source)
    at com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse.callUriRestrictOutput(Unknown Source)
    at com.netscape.server.servlet.platformhttp.PlatformRequestDispatcher.forward(Unknown Source)
    at com.netscape.server.servlet.jsp.JSPRunner.service(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown Source)
    at com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Compiled Code)
    at com.kivasoft.applogic.AppLogic.execute(Compiled Code)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at com.kivasoft.thread.ThreadBasic.run(Compiled Code)
    at java.lang.Thread.run(Compiled Code)

    Hi,
    Yes, I was able to code this sucessfully and got it working. Here is the code I used...
    <%
    String fortune = (String) request.getAttribute("fortune_string");
    %>
    <HTML>
    <HEAD><TITLE>Fortune Sample Application</TITLE></HEAD>
    <BODY BGCOLOR=#FFFFFF>
    <H2>The Oracular Servlet greets you!</H2>
    <p>
    Your fortune is...
    <%= fortune%>
    <p>
    <p>
    <hr size=0>
    <p>
    <FONT SIZE=2>Sample Applications
    <jsp:forward page="/ias-samples/index.html">
    </jsp:forward>
    </BODY>
    </HTML>
    and I got it working. I believe the code is missing some tag, which I tried, but got error in KJS like...
    [15/Feb/2002 11:23:49:7] info: --------------------------------------
    [15/Feb/2002 11:23:49:7] info: jsp.APPS.fortune.fortune: init
    [15/Feb/2002 11:23:49:7] info: --------------------------------------
    Null text data??
    2002-02-15 11:24:16 - error-the file '\fortune.jsp' generated the following pars
    e exception: org.apache.jasper.compiler.ParseException: C:\iplanet\ias6\ias\APPS
    \fortune\fortune\fortune.jsp(17,0) Expected "param" tag with "name" and "value"
    attributes after the "params" tag.
    In your case, I suspect, either the parser is not able to convert the .jsp file appropriately, or some inappropriate tag. If this doesn't help please send me your code & I can help you on this regard.
    Regards
    Raj
    [email protected]

  • Error in accessing servlet from JSP

    Hello everybody,
    When I access a servlet from a JSP page,I am getting the following error message :
    Error 404--Not Found
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    10.4.5 404 Not Found
    The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.
    If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address.
    I am using Weblogic 7.0 and my web.xml code is as follows:
    <web-app>
    <servlet>
    <servlet-name>TestServlet</servlet-name>
    <servlet-class>TestServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>TestServlet</servlet-name>
    <url-pattern>/TestServlet</url-pattern>
    </servlet-mapping>
    </web-app>
    I am accessing the servlet from a javascript function in my JSP page.
    I am quite new to the Java technology. So any help in this regard would be highly appreciated.
    Thanks in advance,

    The form action event is in a javascript function. I am sorry I mentioned that I am accessing this servlet from JSP. Actually,this servlet is accessed from an HTML document.
    The following is the javascript code:
    <script language="javascript">
    function lfnCallNext()
         alert("In the function");
         frmMain.method="POST";
         frmMain.action="/TestServlet";
         frmMain.hidChoice.value="GetList";
         frmMain.submit();
    </script>
    And this function is called from an hyperlink as follows:
    Work with Employee Database
    Thanks,

  • Change protocol when redirecting a request for a servlet to jsp

    Hello,
    In my servlet, There is a line of code:
    getServletConfig().getServletContext().getRequestDispatcher("/page.jsp").forward(request,response);
    My question is: I'd like to change the current protocol (like http) to new protocol (like https) or versa vista before my servlet executes the above line.
    Is this possible to implement that? If so, how can I do it?
    If not implement, Is there any ways to convert back or forward between http and https protocols in java, servlet or jsp?
    I did try to use window.location.href="protocol://myserver/..." in javascript to redirect the jsp page to the right protocol, but the session for the browser was lost, and the jsp page ran into infinite loop.
    Thanks in advance for any helps.
    Mike.

    if (!request.isSecure()) response.sendRedirect("https://me.com/page.jsp");
    (or visa versa)

  • 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.

Maybe you are looking for

  • Days between job raised and completed variable

    Hi, im new to this website and semi new to Desktop intelligence. i have created a report that returns data by job number (i work at a housing association). the job number has 2 lots of data i am trying to interrogate, one is the time the job number w

  • How to call a concurrent program with some parameters in a stored procedure

    Hi All, I have made two procedures, xx_nidhi_proc1 and xx_nidhi_proc2. xx_nidhi_proc1 takes four parameters from front end and is registered as concurrent program in oracle apps and running fine alone. xx_nidhi_proc2 calls the concurrent program of x

  • Refresh Collection Snapshots Error ORA-12008 ORA-01555

    Need some insight! Ct is implementing R12.1.1 ASCP using existing 11.5.10 EBS as source. In source EBS, when running Refresh Collection Snapshots (RCS) in COMPLETE mode, we encounter this error: ORA-12008: error in materialized view refresh path ORA-

  • SD : Fast change Reason for rej.

    Hi, <b>Trasansaction</b>: VA01 / VA02 / Va03 There is this screen : Program SAPMV45A Screen 250 Description : Sales doc. Window  Fast change Reason for rej. How will I get (envoke) this screen, my objective here is to assign/change Reason for rej. fo

  • Missing preference settings

    Hi the "icon" and "windows thumbnail" settings are missing from the File Handling Preferences in photoshop cs6 windows version, any ideas on how to fix this. Thanks