Custom tag in included JSP page cause exception (WLS 5.1 SP 9)
An application use custom tags (JSP Tag extensions) in JSP page
included into another JSP page by means <jsp:include> instruction.
After we had installed Service Pack 9 for Weblogic 5.1
browser's call of including JSP began show an error.
When I remove Weblogic510sp9.jar and Weblogic510sp9boot.jar
references from startWebLogic.cmd, the error diagnostic disappear.
Is Service Pack Number 9 wrong?
==========================
Web browser diagnostic:
Error 500--Internal Server Error
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.5.1 500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling
the request.
==========================
Console diagnostic:
Tue Jun 05 17:40:14 MSD 2001:<I> <WebAppServletContext-dscat> looking for taglib
uri /exttags.tld as resource /WEB-INF/e
xttags.tld in Web Application root:
Tue Jun 05 17:40:15 MSD 2001:<I> <WebAppServletContext-dscat> Generated java file:
C:\weblogic\dscat\WEB-INF\_tmp_war_ds
cat\jsp_servlet\_jsp\_opos\_catalog.java
Tue Jun 05 17:40:25 MSD 2001:<E> <WebAppServletContext-dscat> Servlet failed with
Exception
java.lang.VerifyError: (class: jsp_servlet/_jsp/_opos/_catalog, method: _jspService
signature: (Ljavax/servlet/http/Http
ServletRequest;Ljavax/servlet/http/HttpServletResponse;)V) Register 12 contains
wrong type
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Unknown Source)
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:469)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java,
Compiled Code)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:442)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:228)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:115)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:138)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:915)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:879)
at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
==========================
Including JSP file:
<%@ include file="catalog_real.jsp" %>
==========================
Included JSP file:
<%@ taglib uri="/exttags.tld" prefix="dscat" %>
<dscat:pageheader>Catalog header</dscat:pageheader>
==========================
Tag extansions library (WEB-INF/exttags.tld file):
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>dscat</shortname>
<tag>
<name>pageheader</name>
<tagclass>ru.ibs.xbcat.view.tag.PageHeader</tagclass>
</tag>
</taglib>
==========================
Class PageHeader:
package ru.ibs.xbcat.view.tag;
import java.io.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class PageHeader extends BodyTagSupport {
public int doStartTag() throws javax.servlet.jsp.JspException {
return BodyTag.EVAL_BODY_TAG;
public int doAfterBody() throws javax.servlet.jsp.JspException {
return(SKIP_BODY);
Are you using Jikes? See if this helps ...
http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.jsp&item=6287&utag=
Mike
"Radik Usmanov" <[email protected]> wrote:
>
>An application use custom tags (JSP Tag extensions) in JSP page
>included into another JSP page by means <jsp:include> instruction.
>
>After we had installed Service Pack 9 for Weblogic 5.1
>browser's call of including JSP began show an error.
>When I remove Weblogic510sp9.jar and Weblogic510sp9boot.jar
>references from startWebLogic.cmd, the error diagnostic disappear.
>
>Is Service Pack Number 9 wrong?
>==========================
>Web browser diagnostic:
>
>Error 500--Internal Server Error
>From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
>10.5.1 500 Internal Server Error
>The server encountered an unexpected condition which prevented it from
>fulfilling
>the request.
>
>==========================
>Console diagnostic:
>
>Tue Jun 05 17:40:14 MSD 2001:<I> <WebAppServletContext-dscat> looking
>for taglib
>uri /exttags.tld as resource /WEB-INF/e
>xttags.tld in Web Application root:
>Tue Jun 05 17:40:15 MSD 2001:<I> <WebAppServletContext-dscat> Generated
>java file:
>C:\weblogic\dscat\WEB-INF\_tmp_war_ds
>cat\jsp_servlet\_jsp\_opos\_catalog.java
>Tue Jun 05 17:40:25 MSD 2001:<E> <WebAppServletContext-dscat> Servlet
>failed with
>Exception
>java.lang.VerifyError: (class: jsp_servlet/_jsp/_opos/_catalog, method:
>_jspService
>signature: (Ljavax/servlet/http/Http
>ServletRequest;Ljavax/servlet/http/HttpServletResponse;)V) Register 12
>contains
>wrong type
> at java.lang.Class.newInstance0(Native Method)
> at java.lang.Class.newInstance(Unknown Source)
> at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:469)
> at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java,
>Compiled Code)
> at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:442)
> at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:228)
> at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:200)
> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:115)
> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:138)
> at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:915)
> at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:879)
> at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
> at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
> at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
>Code)
>
>==========================
>Including JSP file:
>...
> <%@ include file="catalog_real.jsp" %>
>...
>
>==========================
>Included JSP file:
>...
> <%@ taglib uri="/exttags.tld" prefix="dscat" %>
>...
><dscat:pageheader>Catalog header</dscat:pageheader>
>...
>==========================
>Tag extansions library (WEB-INF/exttags.tld file):
>
><?xml version="1.0" encoding="ISO-8859-1" ?>
><!DOCTYPE taglib
> PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
> "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
>
><taglib>
> <tlibversion>1.0</tlibversion>
> <jspversion>1.1</jspversion>
> <shortname>dscat</shortname>
>
> <tag>
> <name>pageheader</name>
> <tagclass>ru.ibs.xbcat.view.tag.PageHeader</tagclass>
> </tag>
>
></taglib>
>==========================
>Class PageHeader:
>
>package ru.ibs.xbcat.view.tag;
>
>import java.io.*;
>import javax.servlet.jsp.*;
>import javax.servlet.jsp.tagext.*;
>
>public class PageHeader extends BodyTagSupport {
>
> public int doStartTag() throws javax.servlet.jsp.JspException {
> return BodyTag.EVAL_BODY_TAG;
> }
>
> public int doAfterBody() throws javax.servlet.jsp.JspException {
> ...
> return(SKIP_BODY);
> }
>}
>
Similar Messages
-
Why jsp page cause exceptions in J2EE App. Server
I installed j2ee App Server on my Windows 2000, wrote a simple .jsp, moved the code to domains\domain1\docroot, ran the .jsp from the browser and saw the following exception. I could not find the directory common/lib for my Tomcat server. Please instruct.
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
No Java compiler was found to compile the generated source for the JSP.
This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
to the common/lib directory of the Tomcat server, followed by a Tomcat restart.
If using an alternate Java compiler, please check its installation and access path.
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:132)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:356)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:420)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:463)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:444)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:557)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:306)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:289)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:311)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:205)
****************************************************************************************************************This is a known issue.
The error message about the missing Java compiler is very misleading, and
is being caused by a bug in the way compilation error messages are
being propagated.
Following is a detailed explanation of the behaviour you are seeing:
The misleading error message is printed only in the case where a javac
compilation error line number cannot be mapped back to a line number
in the JSP source code.
The internal representation of a JSP element ("JSP node") in the JSP compiler
contains the following info:
- The begin line number of the JSP element in the JSP page
- The begin and end line numbers ("range") of the Java code that was
generated for the JSP element
When attempting to map a javac error line number back to the JSP
source line, we determine the range into which the javac error line
number falls, and retrieve the JSP source number of the JSP element
associated with that range.
However, in some cases, it is impossible to trace a javac error line
number back to the JSP element that caused the error. For example,
consider the following scriptlet:
<%
String query = request.getParameter("query");
if(query != null) {
out.println(query);
} else {
out.println("(null)");
// } // <-- !Missing brace syntax error
%>
Since the JSP compiler wraps the generated code into a
try-catch-finally block, the above syntax error in the scriptlet
causes havoc with that try-catch-finally block, and results in 3 javac
errors:
<file>jsp.java:<line1>: 'catch' without 'try'
} catch (Throwable t) {
^
<file>jsp.java:<line2>: 'try' without 'catch' or 'finally'
try {
^
<file>jsp.java:<line3>: '}' expected
Notice that all of the above javac error numbers are outside the range
of the java line numbers corresponding to the scriptlet that caused the
error, and therefore cannot be mapped back to any line numbers in the
JSP page source.
AS 8.0 PE does not handle this case correctly, and prints out the
misleading error message (though the real error message can be found
in the server log).
Notice that this problem is going to be fixed in AS 8.1, so that if a
javac error line number cannot be mapped back to a JSP page line
number, the javac error is still returned to the client.
As far as your particular JSP page is concerned, I don't see anything
wrong with it, and it compiles just fine for me.
Do you still have any problems with it?
Jan -
Repeater fails using {container.item} context within included JSP pages
Greetings,
I'm using Bea Workshop 8.1.2 and netui's based framework.
I'm experiencing a problem relating to the use of jsp:insert tags as a way of templating the code as to make it more maintainable and cost effective.
The problem arises when using repeaters and then binding a <netui> tag with a "container.item" context inside the included jsp page.
Example:
On a PageController we define on its scope a rather simple data structure:
public String[] array={"Item1","Item2","Item3"}
The associated index is as follows:
index.jsp
<netui:html>
<netui-data:repeater dataSource="{pageFlow.array}">
<netui-data:repeaterHeader></netui-data:repeaterHeader>
<netui-data:repeaterItem>
<netui:label value="{container.item}"/><br>
</netui-data:repeaterItem>
<netui-data:repeaterFooter></netui-data:repeaterFooter>
</netui-data:repeater>
</netui:html>
This works as expected, it prints the data in the array list. Fine.
Now, with the <jsp:insert> tag usage, we get two files index.jsp and body.jsp:
index.html
<netui:html>
<netui-data:repeater dataSource="{pageFlow.array}">
<netui-data:repeaterHeader></netui-data:repeaterHeader>
<netui-data:repeaterItem>
<jsp:include page="body.jsp" flush="true"/>
</netui-data:repeaterItem>
<netui-data:repeaterFooter></netui-data:repeaterFooter>
</netui-data:repeater>
</netui:html>
body.jsp
<netui:html>
<netui:label value="{container.item}"/>
<netui:label value="{pageFlow.array[0]}"/>
</netui:html>
With this example the {container.item} tag fails with this exception:
"Caught exception when evaluating expression "{container.item}" with available binding contexts [actionForm, pageFlow, globalApp, request, session, appication, pageContext, bundle, container, url, pageInput]. Root cause: com.bea.wlw.netui.script.xscript.IllegalContextStateException: The Tag "com.bea.wlw.netui.tags.html.Label@cb5dce" does not have a valid parent of type DataAccessProvider. The expression "container["item"]" requires a parent of this type."
BUT - and here is my problem with this - the label tag with {pageFlow.array[0]} PRINTS THE DESIRED ELEMENT.
Also, on an extended example with a <form> tag around the main index html and the array structure inside a FormData class, {actionForm.array[0]} ALSO PRINTS THE DESIRED ELEMENT.
Only {container.item} gloriously fails with an exception complaining about IllegalContextStateException.
This is a total nonorthogonal behaviour, the features do not work as expected and indeed, with the importance of repeaters for netui's development, this preclude us from the minimum standard for structured web application design.
Does anyone have any clue about this behaviour? If not a fix, at least an explanation...
Thanks in advance.I am trying to insert multiple rows I when submited I am get ting only 1 row in the DatabaseForm.
my netui.log file shows this error:
29 Oct 2004 17:25:48,941 WARN NetUIReadVariableResolver []: Could not create a ContextFactory for type "com.bea.netuix.servlets.script.PortalVariableResolver$PortalContextFactory" because the ContextFactory implementation class could not be found.
29 Oct 2004 17:26:35,288 ERROR SortFilterColumn []: Unable to load /com/bea/wlw/netui/databinding/grid/filter/filter-window.properties. Using com.bea.wlw.netui.tags.databinding.grid.util.grid
Throwable: java.util.MissingResourceException: Can't find bundle for base name /com/bea/wlw/netui/databinding/grid/filter/filter-window.properties, locale en_US
Stack Trace:
java.util.MissingResourceException: Can't find bundle for base name /com/bea/wlw/netui/databinding/grid/filter/filter-window.properties, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:804)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:773)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:511)
at com.bea.wlw.netui.tags.databinding.grid.column.SortFilterColumn.<clinit>(SortFilterColumn.java:143)
at jsp_servlet._activitychange.__grid._jspService(grid.jsp:21)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at com.bea.wlw.netui.pageflow.PageFlowJspFilter.doFilter(PageFlowJspFilter.java:208) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:316)
at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.superForward(PageFlowRequestProcessor.java:1301)
at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor$DefaultHttpRedirector.forward(PageFlowRequestProcessor.java:1317)
at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.doForward(PageFlowRequestProcessor.java:1199)
at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.processForwardConfig(PageFlowRequestProcessor.java:1093)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:650)
at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:527)
at com.bea.wlw.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:152)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6456)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
29 Oct 2004 17:27:31,164 WARN FlowController []: Could not find exception handler method exceptionHandler for java.lang.ArrayIndexOutOfBoundsException.
29 Oct 2004 17:27:31,165 WARN FlowController []: Could not find exception handler method exceptionHandler for java.lang.IndexOutOfBoundsException.
29 Oct 2004 17:27:31,165 WARN FlowController []: Could not find exception handler method exceptionHandler for java.lang.RuntimeException.
The actionForm uses a FormData which has a Array of all the fields that need to be populated.
Any idea why only 1 row shows up ?.
Thanks
Raghav -
How we can use jsf tags in included jsp enclosed in subview tags
Hello everybody,
I am developing web app by using jsf. I am including a jsp page "header.jsp" into another jsp page "main.jsp". The header.jsp page is enclosed in jsf subview tag on main.jsp page. The header.jsp contains some static html code and some jsf tags like "outputText". When i added tag library url in header.jsp then my app was not even not initiating and i was getting following exception
ERROR [UIComponentTag] Faces context not found. getResponseWriter will fail. Check if the FacesServlet has been initialized at all in your web.xml.
16:22:16,890 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:929)
at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:310)
....Now i removed jsf tag library url from included jsp "header.jsp" so now my app is running but only static html data is being displayed but the value in the jsf tag "outputText" is not being printed in the browser
kindly help me. i would be very thankful....Your question has nothing to do with Sun Java System Directory Server.
Please use the right forum(s).
Thanks -
Error in parsing the taglib tag in the JSP page
Hi
We are trying to deploy and run a Web Application in CE 7.1 SP01. We are successful in deploying and running servlet based web pages, but when it comes to JSP's the taglibs are not parsed and we get the following error message
Runtime error in processing of the JSP file E:\usr\sap\CE1\J01\j2ee\cluster\apps\sap.com\TestNWEAR\servlet_jsp\TestNW\root\admin\main.jsp.
The error is: com.sap.engine.services.servlets_jsp.jspparser_api.exception.JspParseException: Error in parsing the taglib tag in the JSP page. Cannot resolve URI: [webwork]. Possible reason - validation failed. Check if your TLD is valid against its scheme.02004C4F4F5000190000004E000013400191D308B45
Processing HTTP request to servlet [jsp] finished with error.
The error is: java.io.FileNotFoundException: E:\usr\sap\CE1\J01\j2ee\cluster\apps\sap.com\TestNWEAR\servlet_jsp\TestNW\root\admin\webwork (The system cannot find the file specified)02004C4F4F50001900000051000013400191D308B45AF1AB
We followed the below weblog to correct the TLD's in JAVA EE 5 @ SAP but it did not work for us.
/people/community.user/blog/2006/10/13/porting-the-java-blueprint-solutions-catalogue-applications-to-sap-netweaver-application-server-java-ee-5-edition
Any immediate help will be rewarded with full points
Thanks in advance
Lakshmi
Edited by: lakshmi N Munnungi on May 5, 2008 11:36 PM
Edited by: lakshmi N Munnungi on May 5, 2008 11:39 PMHi Lakshmi,
I have also the same problem. If you have found the solution please post it thanks,
Thanks,
Tariq -
Can we include a JSP page in an already included JSP Page
Hi guys,
I have a doubt with JSP include tag. The problem is ..
Can we include a JSP page in an already included JSP Page
AS shown below
I have one JSP page
Index.jsp
-in this I am including "include.jsp"
-Again within the "include.jsp" I am including "include1.jsp"
It is neither giving an error nor displaying the content which is there in the "include1.jsp" but it is displaying the content of "include.jsp"
first of all let me know whether it is possible or no.. If so then why is it not coming and what is required to do this..
fast...
Thanks
Sreenadha Reddy KHi guys,
I have a doubt with JSP include tag. The
g. The problem is ..
Can we include a JSP page in an already included JSP
Page
AS shown below
I have one JSP page
Index.jsp
-in this I am including "include.jsp"
-Again within the "include.jsp" I
he "include.jsp" I am including "include1.jsp"
It is neither giving an error nor displaying the
content which is there in the "include1.jsp" but it is
displaying the content of "include.jsp"
first of all let me know whether it is possible or
no.. If so then why is it not coming and what is
required to do this..
fast...
Thanks
Sreenadha Reddy KIt is possible , u just have to change all the files and save them all again, clear the temp dirs where all the jsp's as compiled. Now after all this try , it should work . -
Adding more custom tags to large product page
Is there any way to add more custom tags past tag_custom4?
That's not possible. Those 4 custom fields is all you can use.
There is a keywords field which you can utilise maybe. I think the tag for
it is .
Cheers,
Mario Gudelj
www.twoblokeswithapostie.com - Talk to us before you tell your clients:
"No, Business Catalyst can't do that."
Adding more custom tags to large product page created by AnneGerber<http://forums.adobe.com/people/AnneGerber>in
eCommerce - View the full discussion<http://forums.adobe.com/message/5050617#5050617 -
In custom tag, trying to include JSP Page, not processing tags
Now I have this in the correct forum!
I am in a custom tag where one of my attributes (myIncludePage) is the name of another JSP file that I want to include. So, in my custom tag doStartTag() I have:
out.println("<td>");
pageContext.include(myIncludePage);
out.println("</td>");
The included page is rendered with the custom tags in it not processed (I see my tags in the generated HTML)
How do I get the included page to be "processed"?
Thanks in advance,
SamSorry, wrong forum, should be in the JSP forum. Hope someone can still help!
-
In custom tag, trying to include JSP page, not processing JSP tags
I am in a custom tag where one of my attributes (myIncludePage) is the name of another JSP file that I want to include. So in my custom tag doStartTag() I have:
out.println("<td>");
pageContext.include(myIncludePage);
out.println("</td>");
The included page is rendered with the custom tags in it not processed (I see my tags in the generated HTML)
How do I get the included page to be "processed"
Thanks in advance
SamSorry, wrong forum, should be in the JSP forum. Hope someone can still help!
-
Are not interpreted JSTL tags in a JSP page including in a servlet.
Hi people,
I have a project where una page (index.jsp) includes a servlet (MyServlet), that consult a persistence class and get a List of objects (Users),
then the servlet passes the List to a Request object and includes another JSP page (showUsers.jsp). And this is conceptually correct, but don´t works, the JSTL tags are not interpreted in showUsers.jsp.
This is my code...
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<c:out value="Show me some things index.jsp"/>
<div style="border-color:red; border:solid; padding-left:60px">
<jsp:include flush="true" page="pepe/MyServlet"/>
</div>
</body>
</html>...and the Servlet...
public class MyServlet extends HttpServlet
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
UserManager um = new UserManager();
List users = um.getUsers(); //This use Hibernate to return a Users List
request.setAttribute("users", (ArrayList) um.getUsers());
request.getRequestDispatcher("/showUsers.jsp").forward(request, response);
}...Finally, we have the showUsers.jsp file....
<c:out value="Show me some thing showUsers.jsp"/>
<table>
<tr>
<th>ID</th>
<th>Name</th>
<th>e-Mail</th>
<th>Type</th>
</tr>
<tr>
<c:foreach items="${requestScope.users}" var="user">
<td><c:out value="${user.id}" /></td>
<td><c:out value="${user.name}" /></td>
<td><c:out value="${user.email}" /></td>
<td><c:out value="${user.type}" /></td>
</c:foreach>
</tr>
</table>This i get as result page...
ID Name e-Mail TypeFinally, this is the code of showUsers.jsp...
<c:out value="Show me some thing showUsers.jsp"/>
<table>
<tr>
<th>ID</th>
<th>Name</th>
<th>e-Mail</th>
<th>Type</th>
</tr>
<tr>
<c:foreach items="[src.User@18f729c, src.User@ad97f5, src.User@d38976, src.User@1e5c339, src.User@17414c8, src.User@7a17]" var="user">
<td><c:out value="" /></td>
<td><c:out value="" /></td>
<td><c:out value="" /></td>
<td><c:out value="" /></td>
</c:foreach>
</tr>
</table>Somebody can help me?
Many thanks,
GonzaloThanks you all guys,
I appreciate very much your help. In response to everyone ...
BalusC wrote:
Is JSTL taglib declared in top of that JSP page? I don't see it back in the posted code snippet. In this example I stuck...
request.getRequestDispatcher("/showUsers.jsp").forward(request, response);By mistake, but this is just a test, the original line of my servlet is...
request.getRequestDispatcher("/showUsers.jsp").include(request, response);As you can see, both (the servlet and the showUser.jsp file) are included in the index.jsp file. So the header...
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>...in the index.jsp file should works (I hope so).
njb7ty wrote:
I assume in your web.xml, you have ''pepe/MyServlet' defined as a servlet tag and servlet map tag? Without that, I don't think your JSP will find the servlet. I'm >not sure you need it in web.xml since I never call a servlet from a JSP page.
I suggest putting System.out.println() throughout your servlet code and out.println() in your JSP pages to see exactly what is called and when.
As a general rule, JSP files are to display data only, and submit back to a servlet. The servlet does all the business logic and dispatches to the appropriate >JSP page. The JSP shouldn't have any business logic. Including the servlet looks kinda like including business logic. Actually, in a MVC design, your >presentation, control, busines, and database layers have their own isolated responsibilities.
I suggest the servlet put data as one java bean in request scope via request.setAttribute() and dispatch to the JSP page. The JSP page gets the data via ><useBean> tag. The JSTL gets the variables from the useBean tag and uses the data from there to display it. Really, this is my web.xml file...
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>src.MyServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/pepe/MyServlet/*</url-pattern>
</servlet-mapping>
</web-app>Regarding putting System.out.println() and out.println(), i did it and thats works.
Respect of your last comment, I am not a expert in MVC, but I understand that the view layer can make calls to the Controller layer, I am wrong?
evnafets wrote:
It's not. However thats not code, but the generated HTML.
As Balusc pointed out it's the result of running this JSP page without importing the tag library at the top.
Because the tag library is not declared, it treats the <c:forEach> and other tags as template text, and basically ignores them.
It then evaluates the ${items} attribute as an expression in template text, calling toString() on it.
Cheers,
evnafets The file showUsers.jsp are included into the index.jsp page, that's have the header taglib. Could this works?
BalusC wrote:
njb7ty wrote:
By the way, I dont think this is the correct format for the foreach tag:
<c:foreach items="[src.User@18f729c, src.User@ad97f5, src.User@d38976, src.User@1e5c339, src.User@17414c8, src.User@7a17]" var="user">You're right friend.
And that's my problem. Any ideas?
Thanks everyone,
Gonzalo -
Could I use jstl tag in the JSP page of Creator 2 final release?
I have a JSP page used to work well in Creator 2EA2. The page
has the following code snippets:
<c:forEach items="${SessionBean1.webQuery1.details}" var="item">
<tr>
<td class="detailKey">
<c:out value="${item.key}"/>
</td>
<td class="detailValue">
<c:out value="${item.value}"/>
</td>
</tr>
</c:forEach>
...Basically, it generates a table columns.
After migrating to Creator2 final release, a fatal exception is thrown
when the page is launched :
Description: An unhandled exception occurred during the execution of the web application. Please review the following stack trace for more information regarding the error.
Exception Details: org.apache.jasper.JasperException
/Page1.jsp(148,132) According to TLD or attribute directive in tag file, attribute items does not accept any expressions
Possible Source of Error:
Class Name: org.apache.jasper.compiler.DefaultErrorHandler
File Name: DefaultErrorHandler.java
Method Name: jspError
Line Number: 43
Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.
Stack Trace:
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:43)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:414)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:155)
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes Any suggestion, or work around?
ThanksThere is something strange in the HTML for you posedt, so I cannot clearly see what you are trying to do in your JSP page. But either of the following kinds of usage would cause this kind of error:
<h:dropDown ... items="<%= ...some Java expression ...>"/>or
<h:dropDown ... items="${...some JSP EL expression...}"/>This is because JSF component tags allow neither Java runtime expressions nor JSP EL expressions (at least in JSF 1.1, which is what Creator 2 supports). The answer is to use a JSF EL expression instead, like this:
<h:dropDown ... items="#{... some EL expression}"/>Craig -
How to access a variable from a dynamically included JSP page
I have a jsp (say main.jsp) using the following in its code :
<jsp:include page="menu.jsp" flush="true" />
I have a variable in menu.jsp which I would like to use in my main.jsp.
How do I get the value of the variable defined in menu.jsp ?
I called this variable in menu.jsp, Public, but this didnot help me use the value of that variable in main.jsp
Any help is highly appreciated.. thnks a lotI do notice the variable var1 has the value populated - in menu.jsp - (from View -->
Source in the browser) but for some reason not able to use it in main.jspI'm not quite sure of the way your jsps are structured from your code snippet but I think there is something to be aware of here that may be part of your problem, namely the difference between the include directive and the include action.
You are currently using the include action, this treats the included resource as a dynamic object - i.e. a request is sent to that resource and the resulting response is included in your page. So when you think of what there is no java variable actually included - you'll just get the resulting HTML that is generated by menu.jsp
The include directive, as in <%@include file=�menu.jsp � %>, on the other hand treats the resource as a static object. This means the actual bytes in the included resource are inserted into the including jsp and then the result of that is compiled and processed, effectively you are cutting and pasting the menu.jsp into your calling jsp. In this case the variable would be available to the calling jsp.
However this approach does bring other difficulties that may break your current code, you'll just have to try it and see what happens.
Hope that's relevant to your problem,
Matt -
Importing Custom Classes into a JSP page
Hello,
I have created custom package com.srjgroup.report. It sits in C:\workspace\src\com\srjgroup\report directory. I have java files as well as compiled classes there. No jar files there.
did amend classpath to point to this directory.
In my JSP page I have the import statement as following
import="java.sql.*, java.util.*, java.text.SimpleDateFormat, com.srjgroup.report.*"It imports all the packages without any errors. However, when I try to use one of the classes in the package, I get error
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 3 in the jsp file: /SQLServer.jsp
Generated servlet error:
SRJReports cannot be resolved to a type
SRJReports is one of the classes that I am trying to use in that package. When I comment out all references to the class, everything is fine.
So, to fix this I moved the entire package to
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\lib direcory, preserving the hierarhy. So, now my custom package is located here:
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\lib\com\srjgroup\report again there are no jar files, only java and classes here. Still, no go.
What am I doing wrong ?Put the class in
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\classes\com\srjgroup\report
One more thing, there is no subdirectory in lib directory. You may look at the example within tomcat for reference. I start from there. -
How can i load A gui JTable bean through jsp:useBean tag in a jsp page
Hi,
i am chiranjit , i am in a jsp project . i am desparately looking a solution for below stated problem:
i want to make a jsp page for master entry , that why i want to load a GUI Java bean in my jsp page.This GUI Bean contaning a JTable in which allow grid type data entry in the jsp page. But i am unable load that bean in the jsp page through jsp:useBean tag in my page.So if you have any solution then send in the forum as early as possible.
Thank you
chiranjitNo can do. JSPs can only output plain HTML (and javascript...) They are not used like normal Java classes.
If you need a complex GUI then you might use an Applet instead. If you want to use a JSP then you are stuck using normal HTML components, like <table> <form...> <input type="text"> etc... -
HOWTO: Display a custom image on a jsp page
You need 4 files.
1. a jsp page (index.jsp)
2. A servlet (myPackage.ImageMaker)
3. A supplier class (myPackage.PluggableSupplier)
4. web.xml (your IDE should supply this)
From the jsp page you're calling the servlet with an <img> tag, and passing it some parameters.
The servlet obtains a BufferedImage from a pluggable supplier class, and returns with an image (png).
The image is displayed on the jsp page. Hope this helps!
================================================================================================
Here's the .jsp file (index.jsp)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Image page</title>
</head>
<body>
<h1>Your image:</h1>
<img src="ImageMaker?Param1=Hello world&Param2=Hello again" />
</body>
</html>================================================================================================
Here's the servlet (ImageMaker.java):
package myPackage;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.*;
import javax.imageio.ImageIO;
import javax.servlet.*;
import javax.servlet.http.*;
public class ImageMaker extends HttpServlet {
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
System.out.println("called");
//Prevent chacing of the image as it's probably intended to be 'dynamic'
response.addDateHeader("Expires", 795294400000L); //<--long ago
response.addHeader("Cache-Control", "no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
response.addHeader("Pragma", "no-cache");
//set mime type and get output stream
response.setContentType("image/png");
OutputStream out = response.getOutputStream();
//catch incoming parameters, as many or few as you want
String parameter1 = request.getParameter("Param1");
String parameter2 = request.getParameter("Param2");
//fetch the buffered image
int width = 100;
int height = 50;
PluggableSupplier ps = new PluggableSupplier(width, height);
BufferedImage buf = ps.fetchBI(parameter1);
/***You can now draw on the original image if you want to add a watermark or label or whatever*********/
Graphics g = buf.getGraphics();
g.setColor(Color.BLACK);
g.drawString(parameter2, 5, 30);
try {
System.out.println("writing...");
ImageIO.write(buf, "png", out);
} catch(IOException ioe) {
System.err.println("Error writing image file: " + ioe);
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}================================================================================================
This is the class that supplies your image (PluggableSupplier.java):
package myPackage;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
public class PluggableSupplier {
BufferedImage buf = null;
Graphics2D g2d = null;
int width = 50;
int height = 50;
public PluggableSupplier(int w, int h) {
if ((w+h)>2) {
this.width = w;
this.height = h;
buf = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
g2d = buf.createGraphics();
public BufferedImage fetchBI(String parameter1) {
if (g2d != null) {
g2d.setColor(Color.RED);
g2d.fillRect(0, 0, width, height);
g2d.setColor(Color.WHITE);
g2d.drawString(parameter1, 5, 15);
return buf;
}================================================================================================
finally, your web.xml should look like this:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<servlet>
<servlet-name>ImageMaker</servlet-name>
<servlet-class>myPackage.ImageMaker</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ImageMaker</servlet-name>
<url-pattern>/ImageMaker</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
</web-app>nullAnother trick I learned (the hard way ;))...it's a good idea to buffer the output before responding. Add the following code to the servlet, in the case of the provided example, where all the other response-related stuff are done:
response.setBufferSize(yourBufferSize);It's a good idea to try and calculate the buffer size as accurately as possible.
Maybe you are looking for
-
Quicktime Pro 7.6.9 crashes when I try to import image sequence
Hi, I'm running Quicktime Pro 7.6.9 on a Windows XP machine with service pack 3. I shot some timelapses with my Nikon D7000 as jpegs and while trying to import the image sequences into Quicktime so I can export them out as .MOVs, I noticed that Quick
-
Images on webpages do not load/cache properly
Using the new Firefox 5.0, I find that many websites don't load properly in that background images and some regular images will seem to load one time, but upon page reload they are gone, and if you reload again, they're back. It's happened on Google
-
Jtree selection problem.....help
hi, I have a desktoppane....inside i m opening some internal frame..... also i have a tree class....which has any leaf name as internal frame title my question is ...when i selected any internal frame it should show selected leaf according to the int
-
OAUG Conference Paper Submission
The collective experience of the independent Oracle Applications Users Group (OAUG) membership is our most valued asset. Share your knowledge, discoveries, solutions, and successes with us at the Fall 2000 Conference at the Hawaii Convention Center i
-
Hi, We have a SAP ECC 6.0 system with support pack SAPKH60009. I have upgraded it to SAPKH60011. SAP has added a new field KSTAR in table BSEG and since the customer have added their own Z fields this table has come up in SPDD or SPAU. I am familiar