tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 11948] - param settings are not evaluated with jsp:include, jsp:param
Date Fri, 23 Aug 2002 14:56:53 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11948>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11948

param settings are not evaluated with jsp:include, jsp:param





------- Additional Comments From serg_main@yahoo.com  2002-08-23 14:56 -------
in simple test all work fine(ExampleN1). But in my engine, jsp:param not work.
I can't make small test and send some part of may file and part of log4j log. 
(Example 2)
URL used in example 2: http://me.askmore/index.jsp?mill.lang=ru_RU&m=8&

Example N1 ---------------------------------------------
main jsp file:
<%@page 
contentType="text/html; charset=utf-8"
language="java"

%>
<jsp:include page="test_include_3.jsp">
	<jsp:param name="test_value" value="russian_string"/>
</jsp:include>


test_include_3.jsp:
<%@page 
contentType="text/html; charset=utf-8"
language="java"
import="java.util.Enumeration"

%><%

out.println("Start list<br>");
Enumeration e = request.getParameterNames();
for (; e.hasMoreElements() ;)
{
	String n = (String)e.nextElement();
	String[] s = request.getParameterValues( n );
	for (int i=0; i<s.length; i++)
		out.print(n+" = "+s[i]+"<br>");
}
out.println("End list<br>");

%>



Part example 2 -----------------------------------------

index.jsp:
<%@page
contentType="text/html; charset=utf-8"
language="java"
import="mill.main.Constants,
        mill.tools.ServletTools,
        mill.db.DBconnect,
        mill.port.InitPage,
        java.util.Enumeration"
%><%

    if (request.getParameter(Constants.NAME_ADMIN_PARAM)!=null)
    {
        DBconnect db_ = DBconnect.getInstance( false );

        InitPage  jspPage =  new InitPage(db_, request, response,
        Constants.URI_START_PAGE, null,
        Constants.NAME_LANG_PARAM, null, null);
        response.sendRedirect(
            response.encodeURL( Constants.URI_LOGIN_PAGE+'?'+jspPage.addURL)
        );
        return;
    }
%>
<jsp:include page="/share/logic/main_shop_logic.jsp"/>
<jsp:include page="/include/contbox11.jsp"/>
<%
	session.setAttribute(Constants.NAME_PORTLET_PARAM, "news_block");
%>
<jsp:include page="/share/ctx/portlet.jsp">
	<jsp:param name="<%= Constants.NAME_PORTLET_PARAM %>" 
value="news_block"/>
</jsp:include>
<%
	session.removeAttribute(Constants.NAME_PORTLET_PARAM);
%>

<!-- </jsp:include page="/share/ctx/news_block.jsp"/\>-->
<jsp:include page="/include/contbox12.jsp"/>


part of /share/ctx/portlet.jsp:
<%@page
pageEncoding="utf-8"
language="java"
import="java.util.Calendar,
        java.util.Enumeration,
        java.io.StringReader,
        java.io.File,
        java.io.FileOutputStream,
        javax.xml.transform.TransformerFactory,
        javax.xml.transform.Transformer,
        javax.xml.transform.Source,
        javax.xml.transform.stream.StreamSource,
        javax.xml.transform.stream.StreamResult,
        mill.db.DBconnect,
        mill.port.*,
        mill.tools.*,
        mill.main.* ,
        mill.portlet.NewsItem,
        mill.portlet.NewsItemXML,
        org.exolab.castor.mapping.Mapping,
        org.apache.log4j.Category,
        java.io.StringWriter,
        mill.startup.InitParam,
        mill.portlet.PortletDescription,
        java.lang.reflect.Method,
        mill.portlet.PortletClassXML,
        mill.portlet.PortletClassBase,
        java.lang.reflect.Constructor"

%><%!

    private  static Category cat =  Category.getInstance( "share-ctx-
portlet.jsp");

    %><%

        InitPage.setContentType(response);

        cat.debug("Start execute portlet");

        for (Enumeration e = request.getParameterNames(); e.hasMoreElements
() ;) {
            cat.debug("Parameter: "+e.nextElement());
        }


// xxxx if type of portlet not specified, redirect to index page.
// Session ID if cookie disabled, will be lost.
        String type__ = (String)session.getAttribute
(Constants.NAME_PORTLET_PARAM);
        if (ServletTools.isNotInit(request, response,
                Constants.NAME_PORTLET_PARAM,Constants.URI_START_PAGE) &&
                (type__== null || type__.length() ==0))
            return;

        cat.debug("#1.00");

        String typePortlet = ServletTools.getString(request, 
Constants.NAME_PORTLET_PARAM);
        if (typePortlet == null || typePortlet.length()==0)
        {
            cat.debug("Parameter jsp:param not initialized. Using param from 
session - "+type__);
            typePortlet = type__;
        }


part of log4j:
70261 INFO  mill.db.DBconnect  - Success create static object mill.db.ORAconnect
79164 INFO  mill.startup.InitParam  - #2.05 start unmarshal portlet list
79254 DEBUG share-ctx-portlet.jsp  - Start execute portlet
79254 DEBUG share-ctx-portlet.jsp  - Parameter: m
79254 DEBUG share-ctx-portlet.jsp  - Parameter: mill.lang
79254 DEBUG share-ctx-portlet.jsp  - #1.00
79274 DEBUG share-ctx-portlet.jsp  - Parameter jsp:param not initialized. Using 
param from session - news_block
79555 DEBUG share-ctx-portlet.jsp  - #12.12.005  constructor is public 
mill.portlet.NewsBlock
(mill.db.DBconnect,javax.servlet.http.HttpServletRequest,javax.servlet.http.Http
ServletResponse,mill.port.InitPage) throws mill.main.NewsException

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message