Servlet forward request

In 5.6 do you know how I can forward a request within a servlet that contains query string parameters.
This does not work:
RequestDispatcher rd = request.getRequestDispatcher("/content/geometrixx/en?message=Test");
rd.forward(request, response);

See discussion here: http://sling.markmail.org/thread/6b3e3sxe2c6plkcj

Similar Messages

  • Trouble forwarding request from a servlet to a JSP in OAS 4.0.8.1 on NT

    The OJSP release notes state that:
    "Servlets and JSP cannot coexist as the same application" and "Requests cannot be passed between two separate applications."
    Does this mean that my attempts to use the
    the servlet RequestDispatcher to forward a request to a JSP are futile? If so, is this a problem that will be fixed in the future? I would like to use this feature!
    This is the code (based on a sample from Sun's JSWDK 1.0.1) that doesn't work:
    servletToJsp.java
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class servletToJsp extends HttpServlet {
    public void doGet (HttpServletRequest request,
    HttpServletResponse response) {
    try {
    getServletConfig().getServletContext().getRequestDispatcher("/jsp/jsptoserv/hello.jsp").forward(request, response);
    } catch (Exception ex) {
    ex.printStackTrace ();
    I am able to use the <jsp:forward page="/servlets/servletToJsp" /> directive to go from a JSP page to a servlet (across two OAS Applications) and I also can forward a request via the dispatcher from one servlet to another in the same OAS application.
    Any help in this area would be appreciated. Thanks.

    I'm using OAS 4.0.8.1
    You mean servlet to JSP does not work and JSP to servlet works for you????Yes - but I've only tried very simply examples.
    That's different from my understanding. If you are using OAS 4081, both cases should not work.
    The problem you mentioned will be fixed in future release of OAS.That's good to know - thanks!
    null

  • Forwarding requests on to non-java pages from servlet.

    I have designed a web application using a form of single controller pattern.
    I have a number of JSPs.
    Each of these JSP's has a form element which if submitted got to a single servlet (Controller)which then forwards on the request to a different class based on the paramter passed. For example this form would call the SubmitFeedback class.
    <form name="feedbackform" method="post" action="<%=request.getContextPath()%>/controller">
    <input type="hidden" name="action" value="SubmitFeedback"/>
    <input type="hidden" name="page"   value="feedback.jsp">
    <tr><td><input type="submit" name="go" value="Go"/></td></tr>
    </table>
    </form>After the class has done its processing it returns what page to go next to the Controller class and this forwards the request on. to the next jsp
    String nextPage = createAction(request.getParameter(PARAM_ACTION)).handleRequest(this,request, response, request.getParameter(PARAM_PAGE));          
    request.getRequestDispatcher(nextPage).forward(request, response);
    return;This is all fine but now I have a sitation where after the user submits the form I want do some processing then forward them onto another page which is not part of my system, nor java. But the RequestDispatcher is only for the current Context within a Servlet Container.
    Could someone explain how I do this, what am Im missing please.

    i am not a JavaScript expert, so I can't be sure this is everything, but:
    1) The javascript has to be put inside a <script></script> block (you also had an extra close bracket):
    <script type="text/javascript">
      <!--
      function validateAccept() {
        toReturn=true;
        if (form.accept.checked==false) {
          alert("You must select at least one checkbox to search");
          toReturn=false;
        return toReturn;
      //-->
    </script>The script block is usually put in the head section also, but that is not necessary.
    2) I would call this function from the onsubit event of the form rather than the onclick of the submit button
    <form  name="form" action="..." method="post" onsubmit="return validateAccept();">
      //...3) You will need to identify the form that you want to use inside the function. Just using the name form won't work, it has to be retrieved from a certain context. The easiest thing is to pass it in as a parameter:
    <script type="text/javascript">
      <!--
      function validateAccept(form) {
    <form  name="form" action="..." method="post" onsubmit="return validateAccept(this);">

  • Using forward(request, response) in Java Servlet

    Hi
    I need help on how to use the forward() method in a java servlet passing a List object and riderecting to another jsp.
    when I use the following code;
    request.getRequestDispatcher(path).forward(request, response);
    I'm getting this message:
    Content modified /content...
    Status
    200
    Message
    OK
    Location
    /content...
    Parent Location
    /content
    Path
    /content...
    Referer
    Thanks,

    Looking at your traces seems like you are forwarding during POST. Seems like issue with your component implementation missing with POST & proxy scripts. Please eloborate more on the exact steps you are following. Alternatively See if this helps.
    org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper req =
    new org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper(slingRequest) {
    public String getMethod() {
    return "GET";
    String path = "/content/.../test.html";
    javax.servlet.RequestDispatcher dispatcher = slingRequest.getRequestDispatcher(path);
    dispatcher.include(req, slingResponse);

  • Servlets and forward(request, response)

    I have a Servlet that is forwarding the request and response objects to one of two JSP's based upon a parameter in the request object. When opening a browser session and entering my servlet with the first parameter (opCorp=MBSUB) the /criteriaRM.jsp is displayed correctly. However, while still in the same browser session when re-entering the servlet with the parameter changed to opCorp=NEW the second JSP /criteriaPL.jsp is never called correctly - ie the page does not load. However, entering the application with a new browser session works fine (opCorp=NEW loads /criteriaPL.jsp in a brand new browser session) - so I know the second JSP is good and the forward syntax OK. Is there something I am missing? I am using the following code in my servlet
                   if (request.getParameter("opCorp").compareTo("MBSUB")==0) {
                        getServletConfig().getServletContext().getRequestDispatcher("/criteriaRM.jsp").forward(request, response);
                   } else {
                        getServletConfig().getServletContext().getRequestDispatcher("/criteriaPL.jsp").forward(request, response);                    
    Any ideas would be much appreciated. Thanks!!

    Ok, your jsp isn't loded but what else does happen then ? Any exception thrown ? Page not found message ?...

  • Javax.servlet.forward.request_uri request attribute

    Hi,
    I have declared a security-constraint on my web application, which redirects to a page with a form.
    I want to know the initial request. It usually can be retrieved in the javax.servlet.forward.request_uri request attribute, so by doing
    request.getAttribute("javax.servlet.forward.request_uri")
    But this always returns me null.
    If I test the same thing on Tomcat, it works fine.
    This attribute come with Servlet 2.4, and Weblogic 11g is JEE 5 compliant (so Servlet 2.5). So it should work.
    Is there a particularity for Weblogic ?
    Regards

    >
    This attribute come with Servlet 2.4, and Weblogic 11g is JEE 5 compliant (so Servlet 2.5). So it should work.
    Is there a particularity for Weblogic ?This attribute does exist and has to be filled when a forward is done. However there's no strict requirement that the j_security_check is handled internally by a forward. If it's not, then that request attribute wouldn't come into play.
    I've never used it, so caveat emptor, but there is a public class we have which does appear to have some methods that may be helpful to you.
    http://download.oracle.com/docs/cd/E17904_01/apirefs.1111/e13941/weblogic/servlet/security/ServletAuthentication.html
    ServletAuthentication allows both form-based authentication and programmatic authentication in servlets. It performs the authentication call through the Realm and sets the user information into the session.And the static getTargetURLFromFormAuthentication method:
    http://download.oracle.com/docs/cd/E17904_01/apirefs.1111/e13941/weblogic/servlet/security/ServletAuthentication.html#getTargetURLForFormAuthentication(HttpSession)
    -steve-

  • How to add a new parameter to a forwarded request?

    Hi all,
    I have a RequestDispatcher that forwards my request into a servlet. However, if some processing error happens I would like to include another parameter (an error message) in my request being forwarded. Oh, yes, I don't want it to be via GET, but via POST.
    So, this
    getServletContext().getRequestDispatcher("/ProcServlet?message=nonononononon").forward(request, response);will not serve for my purposes. Also, I don't want to go into directly writing my new parameter into the outputstream... is there another way to do that via the Servlet/JSP API?
    Thank you all in advance,
    Filipe Fedalto

    ???

  • Servlet to servlet forwarding

    Hello.
    I am writing a small controlling servlet to check certain request parameters before forwarding the request to the appropriate page.
    The controlling servlet is mapped to "/*" under the application so that all requests will hit it first.
    This is how I forward the request.
    Code to check paramaters and decde url
    RequestDispatcher rd = getServletConfig().getServletContext().getRequestDispatcher("/location/file.jspx");
    rd.forward(request,response);
    My problem is that this seems to send the browser into an infinite waiting loop when I type "http://localhost/application/".
    Is this the right way to do it? Any other techniques or suggestions.
    Thanks
    Sawan

    when you type http://localhost/application nothing happens
    now
    when you type http://localhost/application/anything
    you get to the controlling servlet
    The error you are getting in caused by the controller servlet
    does the resource http://localhost/application/location/file.jspx exist
    and whats with the x.

  • ServletInputStream in Servlet Forwarding empty

    Please help me, i think i have a problem.
    After reading and checking "request"
    seem that the xml message soap included in "request" disappear.
    I have to forwarding it to another servlet.
    Is too late? I have lost it?
    Where is it ?
    I use the RequestDispatcher.forward() method for forwarding
    but (i'm sure) the second servlet receives the "request.getInputStream()" empty.
    Who can help me?
    Thanks in advance
    my code :
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    ServletInputStream in = request.getInputStream();
    byte[] fre=null;
    String xml="";     
    while (in.available()>0) {
    try {
    fre = new byte[in.available()];
    in.read(fre);
    xml = xml + new String(fre);
    } catch (Exception exc) {
    exc.printStackTrace();
    if (ckeck(xml)) {     
    request.getRequestDispatcher("myservlet2").forward(request,response);
    }

    You have already read the input stream. Once read, and it gets read, it can not be re-read. If you want the information in both places, read it in the first servlet and store it in a scope that the other servlet can read (like as a request attribute:
      byte[] fre=null;
      String xml="";
      while (in.available()>0) {
        try {
          fre = new byte[in.available()];
          in.read(fre);
          xml = xml + new String(fre);
        } catch (Exception exc) {
          exc.printStackTrace();
      request.setAttribute("xml", xml);
      if (ckeck(xml)) {
        request.getRequestDispatcher("myservlet2").forward(request,response);
    //... then in myservlet2
      String xml = (String)request.getAttribute("xml");

  • IPlanet can't forward request to app server, why?

    My opinion is , iPlanet Web Server 6 + websphere 6 App Server.
    I generate the "plugin-cfg.xml" in WAS6 for connecting to iPlanet, but iPlanet can't forward requests to App Server at all, error log as below:
    "for host 172.17.18.80 trying to GET /DataExpert/jsp/login/Login.jsp, handle-processed reports: The request method is not applicable to this requested resource."
    I guess it must be the configuration problems of iPlanet, what do you think?

    magnus.conf
    #ServerRoot C:/iPlanet/Servers/https-csdopen
    ServerID https-csdopen
    ServerName csdopen
    ExtraPath C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    ErrorLog C:/iPlanet/Servers/https-csdopen/logs/errors
    MtaHost name-of-mail-server
    DNS off
    Security off
    ClientLanguage en
    AdminLanguage en
    DefaultLanguage en
    RqThrottle 128
    Init fn=flex-init access="$accesslog" format.access="%Ses->client.ip% - %Req->vars.auth-user% [%SYSDATE%] \"%Req->reqpb.clf-request%\" %Req->srvhdrs.clf-status% %Req->srvhdrs.content-length%"
    Init fn=load-types mime-types=mime.types
    #Init fn="load-modules" shlib="C:/iPlanet/Servers/bin/https/bin/NSServletPlugin.dll" funcs="NSServletEarlyInit,NSServletLateInit,NSServletNameTrans,NSServletService" shlib_flags="(global|now)"
    #Init fn="NSServletEarlyInit" EarlyInit=yes
    #Init fn="NSServletLateInit" LateInit=yes
    Init fn="load-modules" funcs="as_init,as_handler,as_term" shlib="C:/Program Files/IBM/WebSphere/Plugins/bin/ns41_http.dll"
    Init fn="as_init" bootstrap.properties="C:/Program Files/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/csdopenCell01/nodes/csdopenNode01/servers/webserver1/plugin-cfg.xml"
    obj.conf
    # Use only forward slashes in pathnames--backslashes can cause
    # problems. See the documentation for more information.
    <Object name=default>
    Service fn="as_handler"
    AddLog fn="as_term"
    NameTrans fn="pfx2dir" from="/servlet" dir="C:/iPlanet/Servers/docs/servlet" name="ServletByExt"
    NameTrans fn=pfx2dir from=/mc-icons dir="C:/iPlanet/Servers/ns-icons" name="es-internal"
    NameTrans fn="pfx2dir" from="/manual" dir="C:/iPlanet/Servers/manual/https" name="es-internal"
    NameTrans fn=document-root root="$docroot"
    PathCheck fn=nt-uri-clean
    PathCheck fn="check-acl" acl="default"
    PathCheck fn=find-pathinfo
    PathCheck fn=find-index index-names="index.html,home.html"
    ObjectType fn=type-by-extension
    ObjectType fn=force-type type=text/plain
    Service method=(GET|HEAD) type=magnus-internal/imagemap fn=imagemap
    Service method=(GET|HEAD) type=magnus-internal/directory fn=index-common
    Service method=(GET|HEAD) type=*~magnus-internal/* fn=send-file
    AddLog fn=flex-log name="access"
    </Object>
    <Object name=cgi>
    ObjectType fn=force-type type=magnus-internal/cgi
    Service fn=send-cgi
    </Object>
    <Object name="servlet">
    ObjectType fn=force-type type=text/html
    Service fn="NSServletService"
    </Object>
    <Object name="jsp092">
    ObjectType fn="type-by-extension"
    ObjectType fn="change-type" type="magnus-internal/jsp092" if-type="magnus-internal/jsp"
    Service fn="NSServletService" type="magnus-internal/jsp092"
    </Object>
    <Object name="ServletByExt">
    ObjectType fn=force-type type=magnus-internal/servlet
    Service type="magnus-internal/servlet" fn="NSServletService"
    </Object>
    <Object name="es-internal">
    PathCheck fn="check-acl" acl="es-internal"
    </Object>
    DataExpertClass.obj.conf
    # Sun Netscape Alliance - obj.conf
    # You can edit this file, but comments and formatting changes
    # might be lost when the admin server makes changes.
    # Use only forward slashes in pathnames--backslashes can cause
    # problems. See the documentation for more information.
    <Object name="default">
    Service fn="as_handler"
    AddLog fn="as_term"
    NameTrans fn="strip-params"
    NameTrans fn="pfx2dir" from="/mc-icons" dir="C:/iPlanet/Servers//ns-icons" name="es-internal"
    NameTrans fn="home-page" path="/docs/DataExpert/index.html"
    NameTrans fn="document-root" root="$docroot"
    PathCheck fn="nt-uri-clean"
    PathCheck fn="check-acl" acl="default"
    PathCheck fn="find-pathinfo"
    PathCheck fn="find-index" index-names="index.html,home.html"
    ObjectType fn="type-by-extension"
    ObjectType fn="force-type" type="text/plain"
    Service method="(GET|HEAD)" type="magnus-internal/imagemap" fn="imagemap"
    Service method="(GET|HEAD)" type="magnus-internal/directory" fn="index-common"
    Service method="(GET|HEAD)" type="*~magnus-internal/*" fn="send-file"
    AddLog fn="flex-log" name="access"
    </Object>
    <Object name="cgi">
    ObjectType fn="force-type" type="magnus-internal/cgi"
    Service fn="send-cgi"
    </Object>
    <Object name="servlet">
    ObjectType fn="force-type" type="text/html"
    Service fn="NSServletService"
    </Object>
    <Object name="jsp092">
    ObjectType fn="type-by-extension"
    ObjectType fn="change-type" type="magnus-internal/jsp092" if-type="magnus-internal/jsp"
    Service fn="NSServletService" type="magnus-internal/jsp092"
    </Object>
    <Object name="ServletByExt">
    ObjectType fn="force-type" type="magnus-internal/servlet"
    Service type="magnus-internal/servlet" fn="NSServletService"
    </Object>
    <Object name="es-internal">
    PathCheck fn="check-acl" acl="es-internal"
    </Object>

  • Exception while forwarding request to another jsp file.

    Hi
    I am getting following exception when I try to forward request from one jsp file to another using <jsp:forward> . I am using tomcat 5.5.9.
    thanks in advance
    org.apache.jasper.JasperException
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50)
    at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
    at org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatcher.java:66)
    at org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(ApplicationDispatcher.java:81)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:293)
    at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:693)
    at org.apache.jasper.runtime.PageContextImpl.access$1000(PageContextImpl.java:65)
    at org.apache.jasper.runtime.PageContextImpl$11.run(PageContextImpl.java:647)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:645)
    at org.apache.jsp.mseries.SpareCheckSend_jsp._jspService(org.apache.jsp.mseries.SpareCheckSend_jsp:141)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:245)
    at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50)
    at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:534)

    I believe you will need to more clearly describe what you are trying to do and what the problem is that you are having before you get a reply to your question.

  • Forward Request giving java.lang.IllegalStateException

    Hi Friends,
    I am using RequestDispatcher to forwrd my request from one servlet to another
    Here's the code
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class TryServlet extends HttpServlet
    public void service(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String url="jdbc:odbc:con";
    Connection con= DriverManager.getConnection(url,"scott","tiger");     
    Statement stmt=con.createStatement();
    ResultSet rst=stmt.executeQuery("select * from Projects");
    response.setContentType("text/html");
    PrintWriter out=response.getWriter();
    while (rst.next())
    String firstname=rst.getString("PIN");
    String lastname=rst.getString("ProjectTitle");
    out.println("<p> Name:"+firstname+" "+lastname+"");     
    con.close();
    RequestDispatcher rd=getServletContext().getNamedDispatcher("HelloServlet");
    rd.forward(request,response);
    return;
    catch(Exception e)
    e.printStackTrace();
    I m getting the error
    java.lang.IllegalStateException: Cannot forward after response has been committed
    i need to include the two rows of tables before i forwad the request to HelloServlet
    What needs to be done?
    thanx
    Pooja

    Don't spread the generation of output over several servlets. Your first servlet should retrieve the data and your second servlet should display the data.
    Store the data retrieved as a request attribute before forwarding:
    // Data.java
    public class Data  {
      public String _firstname;
      public String _lastname;
      public data(String firstname, String lastname)  {
        _firstname = firstname;
        _lastname = lastname;
        return;
    //  TryServlet.java
    public class TryServlet extends HttpServlet
      List list = new ArrayList();
      while (rst.next())  {  //  store data in list
        String firstname=rst.getString("PIN");
        String lastname=rst.getString("ProjectTitle");
        Data data = new data(firstname, lastname);
        list.add(data);
      con.close();
      request.setAttribute("list", list);  //  store list in request
      RequestDispatcher rd=getServletContext().getNamedDispatcher("HelloServlet");
      rd.forward(request,response);  // list is forwarded as well
      return;
    }In HelloServlet, you get the request's attribute and display the data:
      List list = (List)request.getAttribute("list");  //  retrieve list from request
      Iterator it = list.iterator();
      while (it.hasNext())  {  //  retrieve data from list and display
        Data data = (Data)it.next();
        out.println("<p>Name: " + data._firstname + " " + data._lastname + "</p>");
      }Btw, for displaying the data, a JSP will do better.
    Two Bears.

  • Servlet Forwarding

    After forwarding control to another JSP page or servlet using the RequestDispatcher.forward() method, can the response be modified once the forward method returns? For example,
    RequestDispatcher rd = request.getRequestDispatcher("/somepath");
    rd.forward(request, response);
    response.getWriter().println("Some more output");

    do you mean send the forward and then update the response in the one servlet jsp?
    If so answer is NO
    You can add parameters to the request and add them to the response in the forwarded
    servlet/jsp if that is any help
    servlet_jsp 1:
    request.setAttribute("somemorestuff","more stuff more stuff");
    RequestDispatcher rd = request.getRequestDispatcher("/servlet_jsp2");
    rd.forward(request, response);
    servlet_jsp2:
    String ex = (String)request.getAttribute("somemorestuff");
    response.getWriter().println(ex);

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

  • Forwarding requests to multiple weblogic servers

    Hi,
    I have two applications running on two different Weblogic servers and wish to
    use one Apache web server as a front end interface. I can forward the requests
    from apache to one weblogic server using apache-weblogic bridge.
    Is it possible to forward requests to either one of the weblogic servers based
    on some conditions?
    How do we put IF/ELSE IF type constructs in apache configuration file so that
    it can get requests for both the weblogic servers and then forward the request
    to one of the weblogic servers ? Conditions can be anything like some particular
    path, some data in request header, some constant in apache conf file etc
    Thanks in advance.
    Mandar

    Issue:
    How can IIS 4 or IIS 5 be setup to proxy from one IIS server to
    multiple WLS servers.
    For example:
    http://iisserver/myapp --> proxy http://wls1:7001/test
    http://iisserver/myapp2 --> proxy http://wls2:7001/test
    Resolution:
    Proxying to different weblogic instances with one IIS Server can be
    accomplished by using IIS Virtual Directories.
    a) Create a Web site and two virtual directories for it.
    b) Create two directories for the two virtual directories and copy
    iisproxy.dll to each of the directories.
    c) Create iisproxy.ini files in each directory created at step b. One
    for proxying to WebLogic Server A and another for WebLogic Server B.
    d) Register each iisproxy.dll to each of the virtual directories with
    IIS by specifying the appropriate mime-type. If you want to proxy everything
    for that virtual directory, then you will specify a mime-type of *.
    Please note that specifying a mime-type of * will not work with IIS 4.
    e) Make sure you set the Application Protection to HIGH for each
    Virtual Directory.
    Attachments:
    No Attachments Available
    "PacoG" <[email protected]> wrote in message
    news:40c6eb20$1@mktnews1...
    >
    try {
    NewsRefresh nrefresh=NewsRefreshFactory.getInstance("Please");
    nrefresh.execute("HELP");
    } catch (Exception allexceptions) {
    throw new IKnowIKnowException("Linux+Apache");

Maybe you are looking for

  • How to use parameter id in report

    dear all please solve this problem i use parameter id in alv report and i call another report i m unable to pass parameter to another report regards abhilash

  • Linux and the Sound Blaster Live

    Ive got my hands on a SB Li've 24bit external sound card and after some fiddling around I seem to only have standard stereo and no 5. Audio. My question is has anyone got these things to output 5. on Linux yet. I'm going to have to return it back to

  • Help with windows 8.1 and java

    I have windows 8.1 installed on my laptop and i have been trying to print coupons for a website and its not working. says i need java i installed java but that isnt working either. what should i do now?

  • BIG: differences between intel-safari and PPC-safari...

    I just want to say and discuss this phenomenon because I was unable to find anything about this. I do a bit of web development and I can say that Safari on power-pc machines handles CSS differently than Safari with Intel based Macs . The bottom line

  • Is it possible to merge images from 4 different folders into a single 4x4 image with ps scripting?

    So I have four folders that each contain 970 images.   The images in folder 1 are named exactly the same as the images in folder 2, 3, and 4.   All the images are also 400px in size.   What I'm trying to do is take all images of the same name from ea