Missing Parameters when JSP Forwarding

I am having difficulty with passing parameters when a forward occurs from
one JSP to a second JSP. When I try to get those parameters on the second
JSP I am getting nulls since it never actually receives them as parameters.
Here is what the code looks like ...
first JSP
======
<jsp:forward page="second.jsp" >
<jsp:param name="arg1" value="hi" />
<jsp:forward>
second JSP
========
String arg1 = request.getParameter( "arg1" )
This situation is occuring for me on iPlanet Web Server 4.1. (Fyi, when I
use the same JSPs on Tomcat through JBuilder, the parameter is passed to the
second JSP.) I am wondering if if I am missing something on how iPlanet
wants me to do pass arguments when forwarding or whether I just need to find
an alternative way to accomplish my goal. Thanks in advance.

In your second JSp try using.
String arg1 = (String) request.getAttribute('arg1");
I'm not sure if this is correct but from my understanding of Servlets you can not set a parameter programatically without overriding the ServletRequest. However, you can set an attribute. If this does not work then the following absolutely will:
JSP 1
<% request.setAttribute("args1","hi");
<jsp:forward page="second.jsp"/>
JSP 2
<% String param = (String) request.getAttribute("arg1"); %>
Hope this helps

Similar Messages

  • Missing Parameters when using .PrintToPrinter or .ExportToDisk

    I am creating a viewer that will set login information and allow the users to view, print or export reports.  VB.NET 2010 WinForms Crystal Engine 13.0.9.1312.  All reports are external designed by various programmers.
    The preview mode of my viewer is now working quite well (with the help of Don and Ludek most recently).  Anything I want to see on screen works great in the regular Crystal viewer.
    The problem is when I want to export to pdf or print to a printer without viewing on screen in the regular Crystal viewer.
    If there are no parameters in the reports, both exporting to pdf and printing to any printer selected works.
    When there is one or more parameters, it crashes and points to the line
    crReport.ExportToDisk(ExportFormatType.PortableDocFormat, strFile)
    or
    crReport.PrintToPrinter(1, True, 0, 0)
    with the message Missing Parameter Values.
    Through some searching (and yes I have checked on this site and Google for "Missing Parameter Values") I have found one big issue is that parameter values have to be set after the .ReportSource is set.  So before I changed my code, I never saw the Crystal Parameter prompt screen.  Now I see it but still get the crash (though once I have had it go to printer honouring the Parameter in a report, but I can't always reproduce it and never when sending to pdf).
    The reports may be designed by end users who are using my program.  I will not know what reports they are or if they have even put in parameters.  I will not know if they are date, string, number, discrete, range, multiple, etc.
    The original login code referred to below can be found here.
             'original login code here down to subreport login
             'rest of subroutine is just a Catch and End Try
             crViewer.ReportSource = Nothing
             crViewer.ReportSource = crReport
             'check if to be sent direct to printer and send all pages
             If Not autoforms Is Nothing AndAlso autoforms.ToPrinter Then
                crReport.PrintOptions.PrinterName = autoforms.Printer
                crReport.PrintToPrinter(1, True, 0, 0)   '-> Error Triggers Here
             End If
             'setup viewer options
             Dim intExportFormatFlags As Integer
             intExportFormatFlags = ViewerExportFormats.PdfFormat Or
                                     ViewerExportFormats.ExcelFormat Or
                                     ViewerExportFormats.ExcelRecordFormat Or
                                     ViewerExportFormats.XLSXFormat Or
                                     ViewerExportFormats.CsvFormat
             crViewer.AllowedExportFormats = intExportFormatFlags
             crViewer.ShowLogo = False
             crViewer.ToolPanelView = ToolPanelViewType.GroupTree
             'check if to be sent direct to pdf and send all pages
             If Not autoforms Is Nothing AndAlso autoforms.ToPDF Then
                Dim strPDFFilename As String = autoforms.PDFPath & "\" & autoforms.ReportName & "_" & autoforms.ReportType & ".pdf"
                'strPDFFilename = Replace(strPDFFilename, " ", "_")
                SendExport(strPDFFilename, "PDF")
             End If
             'if not preview then close form
             If Not autoforms Is Nothing AndAlso Not autoforms.Preview Then
                Me.Close()
                Exit Sub
             End If
    Private Sub SendExport(ByVal strFile As String, ByVal strExportFormat As String)
          'pass current parameter values to the pdf
          Dim crParamFieldDefs As ParameterFieldDefinitions
          Dim crParamFieldDef As ParameterFieldDefinition
          Dim crParamValues As New ParameterValues
          Dim x As Integer = crViewer.ParameterFieldInfo.Count
          crParamFieldDefs = crReport.DataDefinition.ParameterFields
          'loop through each parameter and assign it the current values
          For Each crParamFieldDef In crParamFieldDefs
             crParamValues = crParamFieldDef.CurrentValues
             crParamFieldDef.ApplyCurrentValues(crParamValues)
          Next
          Select Case strExportFormat
             Case Is = "PDF"
                crReport.ExportToDisk(ExportFormatType.PortableDocFormat, strFile)  '--> Error Triggers Here
             Case Is = "xls"
                crReport.ExportToDisk(ExportFormatType.Excel, strFile)
             Case Is = "xlsx"
                crReport.ExportToDisk(ExportFormatType.ExcelWorkbook, strFile)
          End Select
    End Sub
    This code doesn't work on my system, but my logic is as follows (as flawed as it is).  Look through the parameters, find the current values and then assign them to the parameters again just before export.
    With the code above, I am getting the enter parameter values screen in the viewer.  Therefore, my assumption is that the report now has a current value(s) for the parameter(s).  The loop will not require the program to know how may parameters there are or what the values or value types are.
    There are a couple of problems with this.  When I step through it, there are no current values, because the prompt doesn't come up with stepping through the code with F8.  Second problem is that it is finding the internal parameters used for subreport linking ({?PM-xxxxx}).  Third problem is that a lot of code I have looked at does not appear like it is assigning the reportsource to a viewer at all just to export or print to printer.  So is it necessary to do as I have done here?
    I am sorry this is so long and I appreciate anyone who has stuck to it this long.  I am at my wits end trying to figure out how to make this work.  I think there is a timing issue here but do not know how to resolve it.  I just want the report to trigger the prompts if there are parameters, then send the report screen, to pdf or to printer depending on the user's settings for the report (it may be any or all three options).  If you need more info, let me know.
    TIA, rasinc

    Hi
    I'd like to look at this from the "how parameters" work point of view. Then let's see if we can drill in on some of the details.
    The parameter prompt screen is driven by the viewer. E,g.; the screen will only be spawned on invocation of the viewer. If the viewer is not invoked (e.g.; direct print / export) the parameter prompt screen will not be displayed. Now, in your second post you say:
    With the code above, I am getting the enter parameter values screen in the viewer.
    This does not sound correct based on the above. E.g.; if the correct parameters are passed to the engine, the viewer should never be popping up the parameter screen. So to me it looks like the code for the parameter is not actually working. It looks like it is as there is no error as such. But as you get prompted, the engine is essentially saying; "I don't understand those parameters so as smart as I am, I'll use the parameter prompt screen to get them from the user on a silver platter".
    Ok. Now to some troubleshooting. I'd pick a report where I know the parameter type and acceptable values ahead of time. Don't use date or date / time params to start with as these have other complication. Use the parameter code to set the value(s) - preferably one value (I like to keep things simple). If the parameter is passed to the report engine correctly, there will not be a parameter prompt and the report will simply come up in the viewer. Once this works, add in a code for printing / exporting and comment out the viewer code. The report should print / export without any issues (no parameter prompt, no error). Repeat the above with a multi-parameter report.
    Then it will come to those date and date/time parameters. NULL handling, etc., etc. E.g.; this will not be trivial. And you will somehow need to know the parameter type (string / int / date) before you try to pass it into the report. More help:
    Sample apps
    vbnet_win_paramengine.zip
    vbnet_win_paramviewer.zip
    vbnet_win_multirangeparam.zip
    vbnet_win_rangeparameters.zip
    vbnet_win_sub_daterange_param_engine.zip
    vbnet_win_sub_daterange_param_viewer.zip
    The above samples are here: Crystal Reports for .NET SDK Samples - Business Intelligence (BusinessObjects) - SCN Wiki
    Helpful KBAs
    1688710 - When printing a Crystal report with parameters using 'PrintToPrinter' method, report does not prompt for parameter values
    1214110 - How to pass a Date/Time parameter to a report at runtime using VB .NET
    1496220 - Suppress the default parameter prompt when the parameter value is not passed through the code
    1893554 - How to pass a NULL value to a Crystal Reports optional parameter field using Visual Studio .NET
    1425379 - How to avoid being prompted for a parameter when refreshing a report running in a VS .NET application
    1461315 - Error; "Missing Parameter Values" when running a parameterized report using Crystal Reports SDK for VS .NET
    1215426 - Err Msg: "Missing parameter value" when printing or exporting in VS .NET
    And finally this:
    Crystal Reports for Visual Studio 2005 Walkthroughs
    (The above doc is good for all versions of CR and VS. It has some amazingly great "stuff" in it re. parameters, etc., and more.)
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • UWL object link missing parameters when jump to external page via portal

    We configured SWFVISU in ECC to jump out to an external application via a portal page. Our resultant URL looks like this:
    http://XYZ:50000/irj/servlet/prt/portal/prteventname/Navigate/prtroot/pcd!3aportal_content!2fevery_user!2fgeneral!2fdefaultDesktop!2fframeworkPages!2fcom.xyz.portal.frameworkpage!2fcom.sap.portal.innerpage!2fcom.sap.portal.contentarea?NavigationTarget=ROLES%3A%2F%2Fportal_content%2Fcom.xyz.pct.xyz%2Fcom.xyz.pct.rols.func_Sales_Representative1%2Fcom.xyz.pct.wrks.s.func_Sales%2Fcom.xyz.pct.pgs.func_Order_Accounts_OA&uname=USER.CORP_LDAP.mdeklerk&langu=EN
    BUT the work item object link parameter i.e. Sales Order No. does not get passed/attached to the string. What are we missing?

    It is passed as an implicit UWL parameter and will not be displayed in URL. You can read this parameter from webdynpro application.

  • Passing FORM parameters when opening form from a JSP

    Hi,
    is it possible to pass form parameters when opening the form from a JSP as a URL. If yes then what should be the way in which parameters has to be passed.
    thanks.

    Hi,
    Sorry there was some confusion.
    I want to pass parameters to a (D2K) form from a JSP. I'm able to open the D2K form but unable to pass the parameters into that form.
    Is it possible to pass parameters to D2k FORM from a JSP...
    Thanks

  • Stationary images missing/segmented when email is forwarded

    I used one of the Mail Stationaries to send an email. The email recipient was able to view the mail correctly with all the images/graphics, but when he forwarded the email, all the graphics/images in the email was either missing or segmented (a piece of the graphic is in one place in the email and another piece is in a different place in the email).
    Is there a way to preserve the images/graphics in a stationary email when the email is forwarded multiple times?

    this is a problem with the email client of your email recipient, not Mail. if it can not handle emails made using Mail stationery correctly (they are pretty complicated under the hood), there is nothing you can do about it. built in stationery is not customizable and you can not change its programming structure.

  • Urgent! pass parameters between jsp pages

    Does anyone can give an example about how to pass parameters between jsp pages?
    This is what I do:
    pageContext.forward("pag_loginc.jsp?p_idusr=" + strUsr + "&c_password=");
    But when deployed is not working.
    Help is needed.

    can you put that stuff in the session context in the first page, then pull it out in the second page?

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

  • How to use TARGET in jsp:forward ???

    In a link I can use TARGET to display the page in another frame like this:
    <a href="http://localhost:8080/cars/Menu.jsp TARGET=FrameRight>Counties</A>
    Is it possible to do something similar when forwarding a page with the jsp:forward standard action??
    <jsp:forward page=SomePage" /">Would help me out if it was possible.</a>

    No. It is not possible, '<jsp:forward' is not meant for opening the page in a said location. It simply forwards the request to the target jsp. Then your taget JSP will take care of resonding to the request.
    If you want to open the page (jsp) in another frame, just stick on to the anchor tag and append your query string to the target jsp.
    <% String query = "?name=xxx&age=30&dept=22"; %>
    <a href="Target.jsp<%=query%> target="frameright">Counties</a>
    Sudha

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

  • Jsp:forward failed with 'Response already committed'

    I got a "Response already commited" error when using logic:forward or jsp:forward inside a JSP page fragment that is part of a Struts Tiles layout.
    Here is the code fragment included in the layout.jsp.
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <logic:notPresent name="user" scope="session">
         <logic:forward name="login" />
    </logic:notPresent>
    Here is the error message:
    [ServletException in:/WEB-INF/tiles/verifyLogin.jsp] Exception forwarding for name login: java.lang.IllegalStateException: Cannot forward. Response already committed. (Servlet 2.3, SRV 8.4)'

    Jsp normally buffers output in a 8k buffer and write it to the output stream (i.e. "commits") it when:
    1) it is explicitly flushed
    2) the buffer overflow
    3) an jsp include is invoked
    My code is in a layout.jsp file which is referenced in a tiles-definition. The tiles definition is tiles:inserted in a top-level jsp file. I am not sure if tiles uses jsp:include or if there is a way to get jsp:foward to work in the layout.jsp.

  • 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

  • When I forward an email its shown as an attachment

    When I forward an email, the text is missing and the recipient  receives a string of attachments

    That doesn't have any impact on this question that I can see. I tried changing it.
    Here is an example of what I get...
    Begin forwarded message:
    From: Apple Support Communities Updates <[email protected]>
    Subject: [Mac OS X v10.7 Lion] - Re: When I forward an email, the email message is expanded as though I asked for detail. How do I avoid this?
    Date: February 25, 2012 9:46:58 AM MST
    To: John McIntosh <deleted>
    Return-Path: [email protected]
    Delivered-To: deleted
    X-Fda: 65925875400.07
    X-Panda: scanned!
    X-Spam-Summary: 1,0,0,c4c08e28abc2b384,d41d8cd98f00b204,[email protected],[email protected],RULES_HIT:1189:1801:2559:2568:2570:2703,0,RBL:17.151.62.54::.lbl8.mailshell.net -64.201.201.201 62.14.0.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:n ot bulk,SPF:fn,MSBL:none,DNSBL:none,Custom_rules:0:0:0
    X-Filterd-Recvd-Size: 8208
    Received: from bz.apple.com (bz.apple.com [17.151.62.54]) by imf15.hostedemail.com (Postfix) with ESMTP for <[email protected]>; Sat, 25 Feb 2012 16:47:00 +0000 (UTC)
    Received: from sgaurwa147p.hosted.jiveland.com ([65.168.255.156]) by bz.apple.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTP id <[email protected]> for [email protected]; Sat, 25 Feb 2012 08:46:59 -0800 (PST)
    Mime-Version: 1.0
    Content-Disposition: inline
    Content-Type: multipart/mixed; boundary="Boundary_(ID_hkMuP10/zPB1erlqNtE9zg)"
    In-Reply-To: <2-17689245-3-213159-1330185942776.jivesbs.jivemailuser@https://discussions.apple.com/>
    References: <2-17689245-3-213159-1330185942776.jivesbs.jivemailuser@https://discussions.apple.com/>
    Auto-Submitted: yes

  • Jsp:forward param not getting included in my query string

    Hi,
    On a particular JSP page, mine.jsp, I am forwarding to a servlet ...
    <jsp:useBean id="HotelResortDBBean" class="com.lvcva.database.HotelResortDBBean" scope="request" />
    <jsp:forward page="/meetings/meeting-venues/results">
         <jsp:param name="sqftRange" value="${empty param.meetingsqft ? -1 : param.meetingsqft}" />
    </jsp:forward>This forwards to a servlet, when I query "request.getQueryString", it comes up null. However, when I enter the URL, "mine.jsp?sqftRange=-1", the query string returns "sqftRange=-1" as expected. Can someone tell me what I'm doing wrong in the above that is causing the jsp:param to not be added to the query string?
    - Dave

    a forward does not create a new request, and thus the query string is not altered. If you want the query string to change, use a redirect in stead.
    note: even though the query string does not change, the new parameter IS added to the HttpServletRequest object, so you can still fetch the new parameter from it even with the forward.

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

Maybe you are looking for