Repeating parameter names in jsp:include

Hi,
I have this jsp code fragment:
<div>
<jsp:include page="fragment_1.jsp">
<jsp:param name="param" value="hello world!"/>
</jsp:include>
<jsp:include page="fragment_2.jsp">
<jsp:param name="param" value="good morning!"/>
</jsp:include>
</div>
When this code executes, the value for param, as the fragment_2 is included, is "hello world!" and not "good morning!".
How can I use the same name for a param in fragment_2 ?
Pietro

The problem is that nothing in the servlet specifications prohibits a requests from having more that one parameter with the same name. It looks that when you set a parameter with the jsp:param tag that it is appending another parameter with that name.

Similar Messages

  • Remove danger of using a request parameter in a JSP:include

    HI,
    I have a basic include where the filename is controlled by a request parameter:
    <%String fileName = request.getParameter("param1")+".jsp"; %>
    <jsp:include page="<%=fileName%>" flush="true" />This works fine but I am rather worried about the security as some can easily edit the URL to something like this:
    http://www.mysite.com/include.jsp?param1=../../../passwords
    Does anyone have any good security techniques that would strip out anything in param1 that could potentially be rather dangerous?
    Thanks

    Check/test the request parameter before using. Best way is to use a (controller) servlet for this.

  • Valiable file name in JSP include

    Hi,
    I am trying to include a html file in a JSP page. The filename comes from the properties file and hence is a variable. The JSP file that has this include does not cache the JSP page plus it "refreshes" (reloads) ever 30 seconds.
    When I include the HTML file using jsp:include I am not getting the HTML file on alternate browser refreshes. Wierd?
    I then hard coded the filename and included the html file using <% @ include... and it works just fine.
    But I cannot have a variable name in <%@ include.
    Please comment on this wierd behaviour of jsp:include and gimme a solution.
    Thank you all in advance,
    Ravi Mittal

    Sorry this isn't a solution, because I have the very same problem and was just getting ready to post a question when I saw your post. I have also tried using:
    <jsp:include page="<%= myFilename %>" flush="true" />
    as well as
    <%@ include file="<%= myFilename %>" %>
    Neither of these work. This kind of approach seems to work just fine using <jsp:forward....>, but there's something funny about trying to include a file dynamically.
    I would also appreciate a solution. Good luck.
    - Joe

  • Pass parameter to the jsp include

    Hello,
    Is it possible to pass a string to the <jsp:include page ?
    Thanks!
    ~ Kyle

    Use jsp:param.

  • Method parameter names

    I'm using jwsdp-2.0 and jdk1.4
    my question is
    How can i change method parameter names that generated on WSDL file ?
    when I'm trying to use (-g) option with javac command i have the same result.

    The parameter names aren't included in the bytecode.
    Therefor it is impossible to get them.
    Not with reflection, not with other tools.
    I'm afraid, but you'll have to scan the source.

  • How to get a parameter without name in JSP?

    hi everyone, My question is how to get a parameter without name in JSP? I have two pages, 1.html and 2.jsp.
    in 1.html, I embeds some Javascript codes in HTML contents like below ( changed < to ( , > to )):
    function toSubWin( obj )
    window.open('test.jsp?'+obj.firstChild.toString(),'sw');
    (a onClick='toSubWin(this)'style="background:green")focus(/a)
    How can I get the parameter in 2.jsp?
    THANK YOU IN ADVANCE!!

    Does obj.firstChild.toString() evaluate to a "name=value" type of String ?
    Or better what does obj.firstChild.toString(),'sw' evaluate to ? It has to end up in a name=value format, else its just gibberish appended to the url.
    In the jsp, you have to obviously know the name to get the parameter. There's a getParameterNames() method which returns you a Collection of parameter names as Strings, you could probably use that to retrieve the param values.
    Then there's a getParameterMap() method which returns an immutable Map containing parameter names as keys and parameter values as map values. The keys in the parameter map are of type String. The values in the parameter map are of type String array.
    However to what ends you employ them in a program which doesnt know its inputs is a different story.
    cheers,
    ram.

  • How to retrieve the parameter names from a JSP page ? Urgent Please

    Hello,
    Can anybody tell me how to retrieve the parameter names from the JSP
    page. (without using getParameterNames() method.)
    The problem with the getParameterNames() method is I get the Jumbled output.
    I need it very badly
    With regards
    Ananth R
    email:[email protected]
    [email protected]

    Dear duffymo,
    My primary intention is to convert the JSP form information into a XML file.
    If I do not get the Parameter names in the correct order how can I maintain
    tag order in XML file.
    For ex: (JSP PAGE VIEW)
    Name--
    FirstName
    MiddleName
    LastName
    Address--
    Street1
    Street2
    City
    Country
    &so on
    (XML File to be generated)
    <Name>
    <FirstName>Value</FirstName>
    </Name>
    <Address>
    <street1>value</street1>
    </Address>
    & so on
    If I use getParameterNames() to get all the parameter names(Which form the tag names in the XML file ) the Enumeration object it returns will not be in the same order as the text fields in JSP.From this I can not construct a meaningful XML file.
    order means: Order of entry on the page, from top to bottom
    That's it
    Waiting for your responses

  • Flush parameter of jsp:include has no effect on servlet code

    I am running 9.0.3 and my jsp code looks like:
    &lt;jsp:include page =".." flush="false"/&gt;
    but the resulting servlet code is:
    pageContext.include( __url);
    Which defaults to flushing the buffer!
    Does anyone know a work around or if Oracle is going to fix this?
    Thanks,
    Mike

    Try:
    public class ...  extends ...
        private static final boolean antialias = Boolean.getBoolean ("swing.aatext");
        private static Map hintsMap = null;
        @SuppressWarnings("unchecked")
        static final Map getHints() {
           if (hintsMap == null) {
                hintsMap = (Map)(Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints")); //NOI18N
                 if (hintsMap == null) {
                    hintsMap = new HashMap();
                     if (antialias) {
                          hintsMap.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
           return hintsMap;
    ... later in class ...
        @Override
        protected void paintComponent(Graphics g) {
            Graphics2D g2d = (Graphics2D) g;
            g2d.addRenderingHints(getHints());
            super.paintComponent(g);
            ...needed this so custom paint would use AA. In my app I wrote text in my component and it was not AA, this turned it on.
    I don't think I had the same problem you, as my jlabels were always aa.
    Edited by: 805835 on Oct 27, 2010 5:06 PM
    Edited by: 805835 on Oct 27, 2010 5:07 PM

  • Try again: jsp:include fails with NPE in ValueBindingImpl

    JSF 1.1, RichFaces 3.1.3, WebLogic 9.2.2.
    I asked about this a couple of weeks ago, but I didn't get any useful responses.
    I have a simple "toy" application using a tabpanel that works fine right now. There is one tab that I will want to repeat several times, with only variations in the data in the fields (and the tab title). So, I copied the current template of that tab into an include file and I'm trying to include it with "jsp:include" from the original page, with a parameter. I've read all the suggestions about how to get jsp:include working with JSF, but it still doesn't work.
    When I display the page, I just get this:
    java.lang.NullPointerException
         at com.sun.faces.el.ValueBindingImpl.(ValueBindingImpl.java:98)
         at com.sun.faces.application.ApplicationImpl.createValueBinding(ApplicationImpl.java:292)
         at javax.faces.webapp.UIComponentTag.setProperties(UIComponentTag.java:890)
         at org.ajax4jsf.webapp.taglib.UIComponentTagBase.setProperties(UIComponentTagBase.java:80)
         at org.ajax4jsf.webapp.taglib.HtmlComponentTagBase.setProperties(HtmlComponentTagBase.java:78)
         at org.richfaces.taglib.TabTag.setProperties(TabTag.java:568)
         at javax.faces.webapp.UIComponentTag.createComponent(UIComponentTag.java:1017)
         at javax.faces.webapp.UIComponentTag.createChild(UIComponentTag.java:1036)
         at javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:749)
         at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:429)
         at jsp_servlet.__main._jsp__tag42(__main.java:1603)
    ...more...The JSP code for the tab looks like this:
    <rich:tab id="property0"
                name="#{ratingRequest.propertyList[0].propertyID}"
                label="Property: #{ratingRequest.propertyList[0].propertyID}"
                rendered="#{ratingRequest.propertyList[0].used}">
         <f:subview id="propertysubview0">
              <jsp:include page="/faces/propertyTab.jsp">
                   <jsp:param name="propertyIndex" value="0" />
              </jsp:include>
         </f:subview>
    </rich:tab>The file this tries to include is this:
    <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
    <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <f:subview id="includedPropertyPage">
         <h:panelGrid id="propertyPanelGrid" columns="3">
              <h:outputText id="propertyIDOut" value="Property ID"/>
              <h:inputText id="propertyIDIn"
                              value="#{ratingRequest.propertyList[0].propertyID}">
                   <a4j:support id="propertyIDInSupport" event="onchange" reRender="propertyTable"/>
              </h:inputText>
              <rich:message for="propertyIDIn" showDetail="true"/>
              <h:outputText id="valueOut" value="Value"/>
              <h:inputText id="valueIn"
                              value="#{ratingRequest.propertyList[0].value}">
                   <a4j:support id="valueInSupport" event="onchange" reRender="propertyTable"/>
              </h:inputText>
              <rich:message for="valueIn" showDetail="true"/>
         </h:panelGrid>
    </f:subview>For more background, here's the code in the tab before I changed it to use jsp:include, and remember that this works:
    <rich:tab id="property0"
                name="#{ratingRequest.propertyList[0].propertyID}"
                label="Property: #{ratingRequest.propertyList[0].propertyID}"
                rendered="#{ratingRequest.propertyList[0].used}">
         <h:panelGrid id="property0PanelGrid" columns="3">
              <h:outputText id="propertyIDOut" value="Property ID"/>
              <h:inputText id="propertyIDIn" value="#{ratingRequest.propertyList[0].propertyID}">
                   <a4j:support id="propertyIDInSupport" event="onchange" reRender="propertyTable"/>
              </h:inputText>
              <rich:message for="propertyIDIn" showDetail="true"/>
              <h:outputText id="valueOut" value="Value"/>
              <h:inputText id="valueIn" value="#{ratingRequest.propertyList[0].value}">
                   <a4j:support id="valueInSupport" event="onchange" reRender="propertyTable"/>
              </h:inputText>
              <rich:message for="valueIn" showDetail="true"/>
         </h:panelGrid>
    </rich:tab>I don't have the source for the JSF implementation, but when I disassemble the class with the NPE, I see that the exception occurs in the ValueBindingImpl constructor that takes a Application object, and the NPE might occur because either the FacesContext or ExpressionInfoInstancePool is null (I think the former is the most likely, but I don't know why).

    Done. The results are ironically very similar to what happened with the BEA implementation, but I have a feeling this is something else, because it's failing not on the included page, but on a value binding on the main page. Perhaps I'm missing some property settings in my web.xml while using the RI.
    The entire stack trace is pretty large. I would have only included the excerpt from the root cause, but the JSF RI stack trace seems to have some interesting info up to that point. You'll see from the code at the top of the stack that either the FacesContext or the Application is null.
    org.apache.jasper.JasperException: Exception in JSP: /index.jsp:2
    1: <% session.invalidate(); %>
    2: <jsp:forward page="/faces/main.jsp"/>
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    org.apache.jasper.JasperException: Exception in JSP: /main.jsp:104
    101:                <rich:tab id="ratings" name="ratings" label="Ratings">
    102:                     <h:panelGrid id="ratingsPanelGrid" columns="3">
    103:                          <h:outputText id="field3Out" value="Field3"/>
    104:                          <h:inputText id="field3In" value="#{ratingRequest.field3}"/>
    105:                          <rich:message for="field3In" showDetail="true" passedLabel=" "/>
    106:                          <a4j:commandButton id="processRequest" value="Submit Request"
    107:                                             action="#{ratingRequest.processRequest}"
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:346)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152)
         org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
         org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
         org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
         org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
         org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:686)
         org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:45)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    javax.servlet.ServletException: javax.servlet.jsp.JspException: null
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:837)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
         org.apache.jsp.main_jsp._jspService(main_jsp.java:134)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:346)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152)
         org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
         org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
         org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
         org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
         org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:686)
         org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:45)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    java.lang.NullPointerException
         com.sun.faces.util.Util.getValueBinding(Util.java:987)
         com.sun.faces.taglib.html_basic.InputTextTag.setProperties(InputTextTag.java:265)
         javax.faces.webapp.UIComponentTag.createComponent(UIComponentTag.java:1027)
         javax.faces.webapp.UIComponentTag.createChild(UIComponentTag.java:1046)
         javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:761)
         javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:451)
         com.sun.faces.taglib.html_basic.InputTextTag.doStartTag(InputTextTag.java:506)
         org.apache.jsp.main_jsp._jspx_meth_h_005finputText_005f3(main_jsp.java:1375)
         org.apache.jsp.main_jsp._jspx_meth_h_005fpanelGrid_005f3(main_jsp.java:1309)
         org.apache.jsp.main_jsp._jspx_meth_rich_005ftab_005f3(main_jsp.java:1278)
         org.apache.jsp.main_jsp._jspx_meth_rich_005ftabPanel_005f0(main_jsp.java:950)
         org.apache.jsp.main_jsp._jspx_meth_a4j_005fform_005f0(main_jsp.java:208)
         org.apache.jsp.main_jsp._jspx_meth_f_005fview_005f0(main_jsp.java:162)
         org.apache.jsp.main_jsp._jspService(main_jsp.java:124)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:346)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152)
         org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
         org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
         org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
         org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
         org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:686)
         org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:45)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

  • Problem when using jsp:include.. / in JSP when run on OC4J903

    I have a very unusual JSP question when run in OC4J903(EM or standalone) version (previous OC4J version was ok). Here is the description
    1. run P1.jsp and a parameter(text1) will pass to P2.jsp
    2. In P2.jsp, include "includePage.jsp" before show the parameter.
    question:
    1. The P1.jsp parameter will be null if using "POST" method, but "GET" is work.
    anyone have a indea ? or is that a bug in OC4J903 version
    P1.jsp
    <html>
    <head>
    <title>Test</title>
    </head>
    <body>
    <form method=POST action='P2.jsp'>
    <input type=text name='text1' size=30>
    <input type=submit value='OK'>
    </form>
    </body>
    </html>
    P2.jsp
    <html>
    <head>
    <title>Test</title>
    </head>
    <jsp:include page="includePage.jsp" flush="true">
    <jsp:param name="importParam" value="P2 Export" />
    </jsp:include>
    <body>
    <%
    out.print("Here shows the param from P1: " + request.getParameter("text1")+"<br>");     
    %>
    </body>
    </html>
    includePage.jsp
    <%@ page import="java.io.*"%>
    <%
    out.print("Here runs the include page. The param from P2 is: " + request.getParameter("importParam")+"<br>");
    %>

    I have a very unusual JSP question when run in OC4J903(EM or standalone) version (previous OC4J version was ok). Here is the description
    1. run P1.jsp and a parameter(text1) will pass to P2.jsp
    2. In P2.jsp, include "includePage.jsp" before show the parameter.
    question:
    1. The P1.jsp parameter will be null if using "POST" method, but "GET" is work.
    anyone have a indea ? or is that a bug in OC4J903 version
    P1.jsp
    <html>
    <head>
    <title>Test</title>
    </head>
    <body>
    <form method=POST action='P2.jsp'>
    <input type=text name='text1' size=30>
    <input type=submit value='OK'>
    </form>
    </body>
    </html>
    P2.jsp
    <html>
    <head>
    <title>Test</title>
    </head>
    <jsp:include page="includePage.jsp" flush="true">
    <jsp:param name="importParam" value="P2 Export" />
    </jsp:include>
    <body>
    <%
    out.print("Here shows the param from P1: " + request.getParameter("text1")+"<br>");     
    %>
    </body>
    </html>
    includePage.jsp
    <%@ page import="java.io.*"%>
    <%
    out.print("Here runs the include page. The param from P2 is: " + request.getParameter("importParam")+"<br>");
    %>

  • How to Parse Escape Character(&) with JSP Include URGENT

    Hi,
    I guess anyone could help me out.
    I have a JSP file where I am including another JSP file and setting parameter for that include file. Among those parameters one of the parameter is having a value having ampersand with it. like R&D. In such case am i getting following error.
    I dont know how should I get rid of this &.
    I tried converting it to amp; even tried \\& also tried using escape("R&D"). But no success. Can you guys help
    Code:
    <jsp:include page="../hottopics/controller_hottopics1.jsp" flush="true">
    <jsp:param name="UserID" value="<%=username%>" />
    <jsp:param name="kmsid" value="<%=kmsid%>" />
    <jsp:param name="department" value="<%=department%>"/>
    <jsp:param name="location" value="<%=location%>"/>
    <jsp:param name="supportorg" value="<%=supportorg%>"/>
    <jsp:param name="supportflag" value="<%=supportflag%>"/>
    </jsp:include>
    department : R&D
    Error :
    java.lang.IllegalArgumentException
    at javax.servlet.http.HttpUtils.parseQueryString(HttpUtils.java:151)
    at org.apache.tomcat.facade.RequestDispatcherImpl.addQueryString(RequestDispatcherImpl.java:546)
    at org.apache.tomcat.facade.RequestDispatcherImpl.doInclude(RequestDispatcherImpl.java:388)
    at org.apache.tomcat.facade.RequestDispatcherImpl.include(RequestDispatcherImpl.java:270)
    at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:414)
    at ITHelpAlerts_0002dv_00034._0002fITHelpAlerts_0002dv_00034_0002fgadget_0002ejspgadget_jsp_7._jspService(_0002fITHelpAlerts_0002dv_00034_0002fgadget_0002ejspgadget_jsp_7.java:210)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
    at org.apache.tomcat.core.Handler.service(Handler.java:287)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
    at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
    at java.lang.Thread.run(Thread.java:534)

    Okay, not surprising. Like I said, the & has special meaning in URLs, to seperate one parameter from the next. Perhaps you should thing about using request attributes instead of parameters:
    request.setAttribute("department", "R&D");
    //then on recieving side
    String department = (String)request.getAttribute("department");

  • Relatiive Path problem when using JSP:include in web portlet

    Hi
    I am using Oracle Portal 9.0.2, and thus OC4J as the J2EE platform.
    I have created a JSP web portlet that is supposed to inlude a specific static html file, which name is passed to it using a portlet parameter. It works, but I had to create a symbolic link from the applicable J2EE applications's htdocs directory in order to access the content:
    /j2ee/OC4J_Portal/applications/<application>/htdocs/<portlet>/content/
    where /content/ is a symbolic link to another directory altogether.
    I can then access the content from within the portlet with a JSP include tag that looks like :
    docPath = "/htdocs/<portlet>/html/"+doc_path;
    %>
    <br>Include:
    <jsp:include page="<%=docPath%>" flush="true"/>
    I would like to access the content using the JSP include without having to use the symbolic link. Is there a way to do this. I tried using an Apache alias, but that did not work.
    Regards
    Harry

    Hi
    Thanx
    In the end we build up a static URL to the document to be included using:
    String contentLocation="content/";
    docPath = contentLocation+getAdditionalDocPath();;
    out.println("docPath="+docPath);
    String docPathAndName = portletRequest.getParameter("doc_path");
    %>
    <!--
    This java script function calls the display content page with the
    page parameter doc_path (which is in return passes it to the display
    content portlet) in order to retrieve and display specific document
    with a JSP:include tag
    -->
    <script language="JavaScript">
    function generateSectionPath(docName) {
    this.location="http://<%=portletRequest.getServerName()%>:<%=portletRequest.getServerPort()%>/pls/portal/url/page/<%=getPageGroup()%>/content?doc_path="+"<%=docPath%>"+docName;
    <script language="JavaScript">
    function generateRelativePath(docName) {
    this.location="http://<%=portletRequest.getServerName()%>:<%=portletRequest.getServerPort()%>/pls/portal/url/page/<%=getPageGroup()%>/content?doc_path="+docName;
    </script>
    <br>Include:
    <%
    if (portletRequest.getParameter("doc_path") == null) {
    out.println("Error - no doc path specified");
    } else { 
    try { %>
    <jsp:include page="<%=docPathAndName%>" flush="true"/>
    <% } catch (Exception e) {
    out.println("Error retrieving document:"+e.toString());
    } // end if
    %>
    Each link from one included HTML file to another becomes a JS function that points the browser to the portal page that includes the portlet that includes thwe JSP that has the include tag to include the html document that is to be displayed.
    The current relative path the the html document (from a predefined root in the file system that is symbolically linked to the same directory as where the including JSP lives) is stored in a session variable, and appended to the document name that is passed to the page.
    If a full document path, as opposed to just the name, is stored, that no appending is done. However, the path is stripped out and stored in a session variable.
    Ths thing is, sometimes a document name, and sometimes a path is passed to the page. Therefore the requirement to know the path when it is not available. A name only will always be passed subsequent to a request for a document with the full path specified, therefore the session variable mechanism works.
    Thanx for the input
    Harry

  • Unable to run jsp as include using jsp:include tag

    I am trying to run the basic jsp:include sample provided by Oracle in OC4J 10g. When I run the code, It seems like include file is treated as text/html and not run at all. Can somebody help me in figuring out what I am missing here..
    Here is the code for main.jsp
    <jsp:include page="content.jsp">
    <jsp:param name="a" value="1"/>
    <jsp:param name="b" value="2"/>
    <jsp:param name="c" value="3"/>
    </jsp:include>
    Here is the code for content.jsp
    <p> Included Content </p>
    <p> Parameters - ${param.a}, ${param.b}, ${param.c} </p>
    When I run this code in JDeveloper10g using the embedded OC4J as well as Application Server 10g, I get the following output.
    Included Content
    Parameters - ${param.a}, ${param.b}, ${param.c}
    Note that the parameter values are not substituted properly.
    Thanks in advance
    Niraj

    javax.servlet.ServletException: com/sun/tools/javac/Main (Unsupported major.minor version 49.0)
    This is your problem either your tomcat or eclipse is pointing to a wrong jre
    here the problem is you are trying to run a code that was compiled using j2sdk1.5 in j2sdk1.4

  • Using JSP include function

    Using JSP include function + collapse/expand table
    (1) I've got a page A (A.jsp) and a page B (B.jsp) which includes 3 files : the header (head.html) and the side panel of icons (icons.jsp) are the same files for both A.jsp and B.jsp
    but the 3rd file containing the contents, are different for A and B
    (2) icons.jsp
    This is what the side panel of icons is suppose to do. E.g. click on icon1, its submenu will appear and the 3rd file is suppose to link to e.g. A.jsp
    When click on icon2, icon1's submenu will collapse and icon2's submenu will expand and the 3rd file is suppose to link to B.jsp
    The expand/collapse function is written in javascript
    (3) Problem : e.g. when i click on icon1, its submenu wont remain expanded, when it changes to another page, icon1's submenu will collapse back, even though the other page includes the icons.jsp too.
    Hence, i've decided to pass a parameter using JSP to achieve the desired effect. as a result, i include the icons file like this
    <%@ include file="icons.jsp?item=icon1" %>, but the icons.jsp file isnt included into the page at all.
    Is the above include file method possible? And is it possible to use JSP to achieve the effect i've stated?
    Thanx

    sounds more like a html problem.
    Do you have a target with the <a href> of your icons? Sounds like the icon page is being refreshed as well.
    <html>
    <frameset .....>
    <frame src=header.jsp name=head>
    <frameset name=bottom>
    <frame src=icons.jsp name=navigate>
    <frame src=dummy.jsp name=content>
    </frameset>
    </frameset>
    try <img src=niceIcon1.gif>

  • Pass Parameter to second.jsp using "form & action"

    I wrote a JSP Portlet. Like the sample, multipage. But, I need to use <form> to pass the parameter to second.jsp
    The first.jsp include:
    <form name="parameters" method="POST" action="<%= HttpPortletRendererUtil.htmlFormActionLink(request,PortletRendererUtil.PAGE_LINK) + "?" + HttpPortletRendererUtil.portletParameter(request, "next_page") + "=second.jsp" %>" >
    The provider.xml include:
    <pageParameterName>next_page</pageParameterName>
    But, error occur and show as following:
    Wed, 21 Mar 2001 10:20:02 GMT
    No DAD configuration Found
    DAD name:
    PROCEDURE : !null.wwpob_page.show
    URL : http://oraas2:80/pls/null/!null.wwpob_page.show?_pageid=null
    PARAMETERS :
    ===========
    ENVIRONMENT:
    ============
    Do I have to do something with next_page or pageID?
    I have run the first.jsp in the sample that JPDK provided. After each click, the screen will refresh.
    null

    Leo,
    The error you are getting is actually a portal error, you have an incorrect URL.
    http://oraas2:80/pls/null/!null.wwpob_page.show?_pageid=null
    If you notice, after pls, you should have a DAD name such as portal30. Instead you have null. Take a look at your Database access descriptors in Portal and update your URL.
    Sue

Maybe you are looking for