Jstl setLocal in valid
I have a project and need to support multiple language.
use Spring + JSTL to suppport it.
Spring configurations
<bean name="/test.do" class="org.springframework.web.servlet.mvc.ParameterizableViewController">
<property name="viewName" value="test"/>
</bean>
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename"><value>messages</value></property>
</bean>
and there is also messages_de and messages_en under classes directory
And in test.jsp I have following statement.
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<fmt setLocale value="de"/>
Message: <fmt:message key="welcome"/>
I hope to get German for 'welcome', but it seems <fmt setLocal value="de"/> is invalid.
I also add a filter to set charset encoding to 'UTF-8'.
What's the problem here?
Please help!!
I don't know much about Spring, so I can't confirm that side of it.
The JSTL code looks ok as far as it goes. but I don't see you specifying a bundle for it to use anywhere.
Maybe you need a
<fmt:setBundle basename="messages"/> to point JSTL at the same message bundle as the Spring one?
Similar Messages
-
Problem while access database by JSTL through JSP.
I am trying to connect database by using JSTL through jsp.I am getting an exception.Please advise.
Error:
org.apache.jasper.JasperException: XML parsing error on file /WEB-INF/jsp/c.tld: (line 2, col 8): Document is invalid: no grammar found.
at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:140)
at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:200)
at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:140)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:309)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:336)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:750)
at org.apache.jasper.compiler.Parser.parse(Parser.java:77)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:157)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:111)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:183)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:427)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:142)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:445)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
JSP:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<sql:setDataSource scope="application"
driver="sun.jdbc.odbc.JdbcOdbcDriver"
url="jdbc:oracle:thin:@3.173.130.12:1521:cup"
user="sUerName"
password="sPassword"
/>
<sql:query var="Result">
select * from imtinv.imi_error_message
</sql:query>
<html>
<head>
<title>
Error Message Details
</title>
</head>
<body bgcolor="white">
This is the information stored in the Error Message Table in Depot Automation Systems
<table>
<c:forEach items="$(Result.rows)" var="row">
<c:forEach items="$(rows)" var="column">
<tr>
<td align=right>
<b><c:out value="$(column.key)" />:</b>
</td>
<td>
<c:out value="$(column.value)" />:</b>
</td>
</tr>
</c:forEach>
</c:forEach>
</table>
</body>
</html>
Web.xml:
<taglib>
<taglib-uri>
http://java.sun.com/jstl/xml
</taglib-uri>
<taglib-location>
/WEB-INF/jsp/x.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>
http://java.sun.com/jstl/fmt
</taglib-uri>
<taglib-location>
/WEB-INF/jsp/fmt.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>
http://java.sun.com/jstl/sql
</taglib-uri>
<taglib-location>
/WEB-INF/jsp/sql.tld
</taglib-location>
</taglib>
c.tld:
<?xml version="1.0" encoding="UTF-8" ?>
<taglib 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 web-jsptaglibrary_2_0.xsd"
version="2.0">
<description>JSTL 1.1 core library</description>
<display-name>JSTL core</display-name>
<tlib-version>1.1</tlib-version>
<short-name>c</short-name>
<uri>http://java.sun.com/jsp/jstl/core</uri>
<validator>
<description>
Provides core validation features for JSTL tags.
</description>
<validator-class>
org.apache.taglibs.standard.tlv.JstlCoreTLV
</validator-class>
</validator>
<tag>
<description>
Catches any Throwable that occurs in its body and optionally
exposes it.
</description>
<name>catch</name>
<tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
Name of the exported scoped variable for the
exception thrown from a nested action. The type of the
scoped variable is the type of the exception thrown.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Simple conditional tag that establishes a context for
mutually exclusive conditional operations, marked by
<when> and <otherwise>
</description>
<name>choose</name>
<tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class>
<body-content>JSP</body-content>
</tag>
<tag>
<description>
Simple conditional tag, which evalutes its body if the
supplied condition is true and optionally exposes a Boolean
scripting variable representing the evaluation of this condition
</description>
<name>if</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.IfTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
The test condition that determines whether or
not the body content should be processed.
</description>
<name>test</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>boolean</type>
</attribute>
<attribute>
<description>
Name of the exported scoped variable for the
resulting value of the test condition. The type
of the scoped variable is Boolean.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Scope for var.
</description>
<name>scope</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Retrieves an absolute or relative URL and exposes its contents
to either the page, a String in 'var', or a Reader in 'varReader'.
</description>
<name>import</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.ImportTag</tag-class>
<tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class>
<body-content>JSP</body-content>
<attribute>
<description>
The URL of the resource to import.
</description>
<name>url</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the exported scoped variable for the
resource's content. The type of the scoped
variable is String.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Scope for var.
</description>
<name>scope</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the exported scoped variable for the
resource's content. The type of the scoped
variable is Reader.
</description>
<name>varReader</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the context when accessing a relative
URL resource that belongs to a foreign
context.
</description>
<name>context</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Character encoding of the content at the input
resource.
</description>
<name>charEncoding</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
The basic iteration tag, accepting many different
collection types and supporting subsetting and other
functionality
</description>
<name>forEach</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.ForEachTag</tag-class>
<tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class>
<body-content>JSP</body-content>
<attribute>
<description>
Collection of items to iterate over.
</description>
<name>items</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
<attribute>
<description>
If items specified:
Iteration begins at the item located at the
specified index. First item of the collection has
index 0.
If items not specified:
Iteration begins with index set at the value
specified.
</description>
<name>begin</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>int</type>
</attribute>
<attribute>
<description>
If items specified:
Iteration ends at the item located at the
specified index (inclusive).
If items not specified:
Iteration ends when index reaches the value
specified.
</description>
<name>end</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>int</type>
</attribute>
<attribute>
<description>
Iteration will only process every step items of
the collection, starting with the first one.
</description>
<name>step</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>int</type>
</attribute>
<attribute>
<description>
Name of the exported scoped variable for the
current item of the iteration. This scoped
variable has nested visibility. Its type depends
on the object of the underlying collection.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the exported scoped variable for the
status of the iteration. Object exported is of type
javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested
visibility.
</description>
<name>varStatus</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Iterates over tokens, separated by the supplied delimeters
</description>
<name>forTokens</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.ForTokensTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
String of tokens to iterate over.
</description>
<name>items</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description>
The set of delimiters (the characters that
separate the tokens in the string).
</description>
<name>delims</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description>
Iteration begins at the token located at the
specified index. First token has index 0.
</description>
<name>begin</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>int</type>
</attribute>
<attribute>
<description>
Iteration ends at the token located at the
specified index (inclusive).
</description>
<name>end</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>int</type>
</attribute>
<attribute>
<description>
Iteration will only process every step tokens
of the string, starting with the first one.
</description>
<name>step</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>int</type>
</attribute>
<attribute>
<description>
Name of the exported scoped variable for the
current item of the iteration. This scoped
variable has nested visibility.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the exported scoped variable for the
status of the iteration. Object exported is of
type
javax.servlet.jsp.jstl.core.LoopTag
Status. This scoped variable has nested
visibility.
</description>
<name>varStatus</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Like <%= ... >, but for expressions.
</description>
<name>out</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
Expression to be evaluated.
</description>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Default value if the resulting value is null.
</description>
<name>default</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Determines whether characters <,>,&,'," in the
resulting string should be converted to their
corresponding character entity codes. Default value is
true.
</description>
<name>escapeXml</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Subtag of <choose> that follows <when> tags
and runs only if all of the prior conditions evaluated to
'false'
</description>
<name>otherwise</name>
<tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class>
<body-content>JSP</body-content>
</tag>
<tag>
<description>
Adds a parameter to a containing 'import' tag's URL.
</description>
<name>param</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.ParamTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
Name of the query string parameter.
</description>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Value of the parameter.
</description>
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Redirects to a new URL.
</description>
<name>redirect</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.RedirectTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
The URL of the resource to redirect to.
</description>
<name>url</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the context when redirecting to a relative URL
resource that belongs to a foreign context.
</description>
<name>context</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Removes a scoped variable (from a particular scope, if specified).
</description>
<name>remove</name>
<tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class>
<body-content>empty</body-content>
<attribute>
<description>
Name of the scoped variable to be removed.
</description>
<name>var</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Scope for var.
</description>
<name>scope</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Sets the result of an expression evaluation in a 'scope'
</description>
<name>set</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.SetTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
Name of the exported scoped variable to hold the value
specified in the action. The type of the scoped variable is
whatever type the value expression evaluates to.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Expression to be evaluated.
</description>
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Target object whose property will be set. Must evaluate to
a JavaBeans object with setter property property, or to a
java.util.Map object.
</description>
<name>target</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the property to be set in the target object.
</description>
<name>property</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Scope for var.
</description>
<name>scope</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Creates a URL with optional query parameters.
</description>
<name>url</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.UrlTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
Name of the exported scoped variable for the
processed url. The type of the scoped variable is
String.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Scope for var.
</description>
<name>scope</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
URL to be processed.
</description>
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the context when specifying a relative URL
resource that belongs to a foreign context.
</description>
<name>context</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Subtag of <choose> that includes its body if its
condition evalutes to 'true'
</description>
<name>when</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.WhenTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
The test condition that determines whether or not the
body content should be processed.
</description>
<name>test</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>boolean</type>
</attribute>
</tag>
</taglib>
Thanks and Regards,
Velrajan T.For installing JSTL, all you need are the jar files in the web-inf/lib directory.
- No entries in web.xml
- no tld files lying around
- no problems!
I think you may have a versioning problem here.
What version of Tomcat are you using?
With JSP1.2 (eg Tomcat 4), you should be using JSTL1.0. <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
With JSP2.0 (eg Tomcat 5), you should use JSTL1.1. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
Note the difference in the URIs. - the second one includes a /jsp
Currently you are using the URI for JSTL1.0, but you look to have the tld from JSTL1.1. If you are using a JSP1.2 container, I don't think it could read this tld file, hence the error.
Try installing the correct version of JSTL, properly (ie as they tell you in the readme file) and it should all work.
Cheers,
evnafets -
Today I took the time to go through and make JSF work, and after some finding out I made it fly. Luckily I only needed to patch various deployment descriptors... [diffs included]
Perhaps other people can benefit from these expperiences;
1. I needed to patch the TLD's for the scriptfree and permittedTaglibs
libraries, as they are not conforming; and so I couldn't deploy them
with a validating parser.
2. The TLD for the demo-components includes reference to a non-existing
tag, components.taglib.AreaSelectedTag. Again, our pedantic deployment
tool wouldn't allow deployment.
3. In the provided web.xml (inside jsf-components.war, for example),
there is no reference to the ConfigureListener, and so nothing
worked until I added that.
BTW, congrats on the release; good work!
Kresten
Who's at JAOO?
http://www.jaoo.dk
Apple-Mail-719489557
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
x-unix-mode=0644;
name="demo-components.jar:META-INF:components.tld"
Content-Disposition: attachment;
filename="demo-components.jar:META-INF:components.tld"
--- components.tld~ Sat Mar 13 15:57:59 2004
+++ components.tld Sat Mar 13 16:05:43 2004
@@ -170,38 +170,6 @@
<tag>
- <name>area_selected</name>
- <tag-class>components.taglib.AreaSelectedTag</tag-class>
- <body-content>empty</body-content>
- <description>
- Register an AreaSelectedListener, of the class specified by the
- type attribute, with the parent MapComponent in which we are nested.
- </description>
- <attribute>
- <name>binding</name>
- <required>false</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- Component reference expression for this component.
- </description>
- </attribute>
- <attribute>
- <name>type</name>
- <required>true</required>
- <rtexprvalue>false</rtexprvalue>
- <description>
- Fully qualified name of a JavaBean class (which must implement
- components.components.AreaSelectedListener) to be registered.
- </description>
- </attribute>
- </tag>
- <tag>
<name>data_repeater</name>
<tag-class>components.taglib.DataRepeaterTag</tag-class>
<body-content>JSP</body-content>
Apple-Mail-719489557
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
x-unix-mode=0644;
name="standard.jar:META-INF:permittedTaglibs.tld.diff"
Content-Disposition: attachment;
filename="standard.jar:META-INF:permittedTaglibs.tld.diff"
--- permittedTaglibs.tld~ Sat Mar 13 15:42:51 2004
+++ permittedTaglibs.tld Sat Mar 13 15:43:48 2004
@@ -3,22 +3,26 @@
<taglib 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 web jsptaglibrary_2_0.xsd"
+ "http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
version="2.0">
<description>
Restricts JSP pages to the JSTL tag libraries
</description>
+ <display-name>permittedTaglibs</display-name>
<tlib-version>1.1</tlib-version>
- <jsp-version>2.0</jsp-version>
<short-name>permittedTaglibs</short-name>
<uri>http://jakarta.apache.org/taglibs/standard/permittedTaglibs</uri>
- <display-name>permittedTaglibs</display-name>
<validator>
<validator-class>
javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV
</validator-class>
<init-param>
+ <description>
+ Whitespace-separated list of taglib URIs to permit. This example
+ TLD for the Standard Taglib allows only JSTL 'el' taglibs to be
+ imported.
+ </description>
<param-name>permittedTaglibs</param-name>
<param-value>
http://java.sun.com/jsp/jstl/core
@@ -26,11 +30,6 @@
http://java.sun.com/jsp/jstl/sql
http://java.sun.com/jsp/jstl/xml
</param-value>
- <description>
- Whitespace-separated list of taglib URIs to permit. This example
- TLD for the Standard Taglib allows only JSTL 'el' taglibs to be
- imported.
- </description>
</init-param>
</validator>
</taglib>
Apple-Mail-719489557
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
x-unix-mode=0644;
name="standard.jar:META-INF:scriptfree.tld.diff"
Content-Disposition: attachment;
filename="standard.jar:META-INF:scriptfree.tld.diff"
--- scriptfree.tld~ Sat Mar 13 15:42:51 2004
+++ scriptfree.tld Sat Mar 13 15:45:46 2004
@@ -3,51 +3,50 @@
<taglib 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 web jsptaglibrary_2_0.xsd"
+ "http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
version="2.0">
<description>
Validates JSP pages to prohibit use of scripting elements.
</description>
<tlib-version>1.1</tlib-version>
- <jsp-version>2.0</jsp-version>
<short-name>scriptfree</short-name>
<uri>http://jakarta.apache.org/taglibs/standard/scriptfree</uri>
<validator>
+ <description>
+ Validates prohibitions against scripting elements.
+ </description>
<validator-class>
javax.servlet.jsp.jstl.tlv.ScriptFreeTLV
</validator-class>
<init-param>
- <param-name>allowDeclarations</param-name>
- <param-value>false</param-value>
<description>
Controls whether or not declarations are considered valid.
</description>
+ <param-name>allowDeclarations</param-name>
+ <param-value>false</param-value>
</init-param>
<init-param>
- <param-name>allowScriptlets</param-name>
- <param-value>false</param-value>
<description>
Controls whether or not scriptlets are considered valid.
</description>
+ <param-name>allowScriptlets</param-name>
+ <param-value>false</param-value>
</init-param>
<init-param>
- <param-name>allowExpressions</param-name>
- <param-value>false</param-value>
<description>
Controls whether or not top-level expressions are considered valid.
</description>
+ <param-name>allowExpressions</param-name>
+ <param-value>false</param-value>
</init-param>
<init-param>
- <param-name>allowRTExpressions</param-name>
- <param-value>false</param-value>
<description>
Controls whether or not expressions used to supply request-time
attribute values are considered valid.
</description>
+ <param-name>allowRTExpressions</param-name>
+ <param-value>false</param-value>
</init-param>
- <description>
- Validates prohibitions against scripting elements.
- </description>
</validator>
</taglib>
Apple-Mail-719489557
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
x-unix-mode=0644;
name="web.xml.diff"
Content-Disposition: attachment;
filename=web.xml.diff
--- web.xml~ Sat Mar 13 15:42:05 2004
+++ web.xml Sat Mar 13 18:19:09 2004
@@ -88,6 +88,11 @@
</description>
</context-param>
+ <!-- make JSF load the configuration -->
+ <listener>
+ <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
+ </listener>
+
<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
Apple-Mail-719489557--The fact that you need a reference to ConfigureListener means there's a bug in the servlet engine you're using - a proper Servlet 2.3 & JSP 1.2 engine would automatically load that listener. So that ain't a bug in JSF.
The other things look like bugs in the demo parts of JSF - not problems with the core of the JSF RI.
-- Adam Winer (EG member) -
How to iterate dyna validation form using jstl tag
i have create dyna validation form in struts-config.xml
<form-bean name="DynaValidationForm"
type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="username" type="java.lang.String" />
<form-property name="cityName" type="java.lang.String[]" />
<form-bean>
and i want to disply these value on my jsp by usig jstl tag
<c:forEach var="form" item="${DynaValidatorForm.????????}">
<c:out value="form.username">
</c:forEach>
but problem is item is of collection object And in dyna validation form
how can i create the collection object or to call this .
please help meposting the same question more than once won't
increase your chances of getting an answer.
sometimes nobody knows or no one is interested in
putting in the time to figure out an answer. your
question might be one of those.
%sometimes I get the feeling that I'm actually helping someone do me out of a job. -
JPA2 / Hibernate on WL 10.3.5: exception in Bean Validation
Hi all,
I am deploying on Weblogic 10.3.5. Our application uses JPA 2.0 and our provider is Hibernate 4.1.7. So far this has been working for us without a problem.
My problems started when I tried to add Bean Validation (JSR-303) implemented by the Hibernate Validation, as I get a strange stacktrace where Hibernate Validator looks up the classpach for loaded JPA providers, and instead of Hibernate, OpenJPA comes up, a version that is incompatible with JPA 2.
JPA 2 + Hibernate work properly for months now, so there is no doubt as to whether JPA 2 has been enabled properly.
Apparently, this has been recorded as an issue on Hibernate Jira ( [HV-425|https://hibernate.onjira.com/browse/HV-425] ), but with a different persistence provider and an earlier Weblogic version (10.3.3 and 10.3.4).
Is there something I have mis-configured that is preventing Hibernate to be picked up as my persistence provider?
This is my EJB code where I try to validate my top-level entity:
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public void saveResult() throws ResultInvalidException{
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
Validator validator = factory.getValidator();
Set<ConstraintViolation<FullResultsSet>> violations = validator.validate(result);
if(!violations.isEmpty()) {
throw new ResultInvalidException(violations);
result.setCreatedDate(new Date());
if(result.getRevisionNumber() != null) {
result.setRevisionNumber(result.getRevisionNumber() + 1);
} else{
result.setRevisionNumber(1L);
if (result.getFullResultsSetId() == null) {
getEm().persist(result);
getEm().flush();
}This is my startWeblogic.cmd (I have added the JSF 2 libraries):
@ECHO OFF
@REM WARNING: This file is created by the Configuration Wizard.
@REM Any changes to this script may be lost when adding extensions to this configuration.
SETLOCAL
set USER_MEM_ARGS=-Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:+DisableExplicitGC -XX:+UseParNewGC -XX:ParallelGCThreads=14 -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=31 -XX:CMSInitiatingOccupancyFraction=75
set PRODUCTION_MODE=false
set debugFlag=true
set DEBUG_PORT=8453
set JAVA_OPTIONS=%JAVA_OPTIONS% -Djava.compiler=NONE -Djava.awt.headless=true
set DOMAIN_HOME=C:\dbin\WLS103~1\user_projects\domains\eudract_domain
set PRE_CLASSPATH=%MW_HOME%\modules\javax.persistence_1.0.0.0_2-0-0.jar;%MW_HOME%\modules\com.oracle.jpa2support_1.0.0.0_2-0.jar;
call "%DOMAIN_HOME%\bin\startWebLogic.cmd" %*
ENDLOCALThese are the contents of my .ear/WEB-INF/lib file:
commons-beanutils-1.7.0.jar
commons-collections-3.2.jar
commons-digester-1.8.1.jar
commons-io-1.4.jar
commons-lang-2.4.jar
commons-lang3-3.0.1.jar
commons-logging-1.1.1.jar
commons-validator-1.2.0.jar
YYYYYY-public-domain-1.2.1-SNAPSHOT.jar
YYYYYY-secure2public-1.2.1-SNAPSHOT.jar
dom4j-1.6.1.jar
dozer-5.3.0.jar
ehcache-core-2.3.1.jar
el-api-1.0.jar
el-impl-1.0.jar
el-messages-1.0.jar
XXXXXXX-cache-1.0.0.jar
XXXXXXX-configuration2-1.0.0.jar
XXXXXXX-domain-8.5.0-SNAPSHOT.jar
XXXXXXX-enumerations-8.5.0-SNAPSHOT.jar
XXXXXXX-jsf-tools-8.5.0-SNAPSHOT.jar
XXXXXXX-main-configuration-8.5.0-SNAPSHOT.jar
XXXXXXX-utils-1.0.0.jar
XXXXXXX-xml-model-8.5.0-SNAPSHOT.jar
hibernate-commons-annotations-4.0.1.Final.jar
hibernate-core-4.1.7.Final.jar
hibernate-entitymanager-4.1.7.Final.jar
hibernate-jpa-2.0-api-1.0.1.Final.jar
hibernate-validator-4.3.1.Final.jar
imaging-01012005.jar
javassist-3.15.0-GA.jar
jboss-logging-3.1.0.GA.jar
jboss-transaction-api_1.1_spec-1.0.0.Final.jar
jcaptcha-1.0.jar
jcaptcha-api-1.0.jar
jsf-api-2.0.jar
jsf-facelets-1.1.15.jar
jsf-impl-2.0.1-FCS.jar
jstl-1.1.2.jar
log4j-1.2.13.jar
oro-2.0.8.jar
quartz-1.5.2.jar
ZZZZZZZ-configuration-0.6-SNAPSHOT.jar
ZZZZZZZ-domain-0.6-SNAPSHOT.jar
ZZZZZZZ-logic-api-0.6-SNAPSHOT.jar
ZZZZZZZ-persistence-0.6-SNAPSHOT.jar
richfaces-api-3.3.3.Final.jar
richfaces-impl-jsf2-3.3.3.Final.jar
richfaces-ui-3.3.3.Final.jar
slf4j-api-1.4.2.jar
slf4j-log4j12-1.4.2.jar
validation-api-1.0.0.GA.jar
velocity-1.7.jar
weblogic-di-10.3.5.jar
xml-apis-1.0.b2.jarThis is the stacktrace:
javax.faces.FacesException: #{ResultBean.saveResult}: javax.ejb.EJBException: EJB Exception: : java.lang.AbstractMethodError: org.apache.openjpa.persistence.PersistenceProviderImpl.getProviderUtil()Ljavax/persistence/spi/ProviderUtil;
at javax.persistence.Persistence$PersistenceUtilImpl.isLoaded(Unknown Source)
at org.hibernate.validator.internal.engine.resolver.JPATraversableResolver.isReachable(JPATraversableResolver.java:57)
at org.hibernate.validator.internal.engine.resolver.DefaultTraversableResolver.isReachable(DefaultTraversableResolver.java:130)
at org.hibernate.validator.internal.engine.resolver.SingleThreadCachedTraversableResolver.isReachable(SingleThreadCachedTraversableResolver.java:46)
at org.hibernate.validator.internal.engine.ValidatorImpl.isCascadeRequired(ValidatorImpl.java:1250)
at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:463)
at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:312)
at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:133)
at eu.ema.eudract.results.result.ResultStatefulServiceBean.saveResult(ResultStatefulServiceBean.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy252.saveResult(Unknown Source)
at eu.ema.eudract.results.result.ResultStatefulServiceBean_6puf0g_ResultStatefulServiceImpl.__WL_invoke(Unknown Source)
at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:39)
at eu.ema.eudract.results.result.ResultStatefulServiceBean_6puf0g_ResultStatefulServiceImpl.saveResult(Unknown Source)
at eu.ema.eudract.results.presentation.result.ResultBean.saveResult(ResultBean.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.el.parser.AstValue.invoke(Unknown Source)
at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:329)
at org.ajax4jsf.component.AjaxViewRoot.broadcastEventsForPhase(AjaxViewRoot.java:304)
at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:261)
at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:474)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:90)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)Adding to the question above, following is my struts.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation"
value="false" />
<constant name="struts.devMode" value="false" />
<constant name="struts.custom.i18n.resources"
value="ApplicationResources" />
<package name="default" extends="struts-default" namespace="/">
<action name="login"
class="struts2.action.LoginAction">
<result name="success">Welcome.jsp</result>
<result name="error">Login.jsp</result>
</action>
</package>
</struts>
--------------------------------------------------------------------------------------- -
Unable to load class from JSTL
Hello. I am using JSTL 1.06 from Jakarta with Tomcat 4.1 on a MacOS X 10.3.9 server. I have a jsp that contains the following:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<jsp:useBean id="validate" class="mypackage.ValidationBean" scope="request">
<jsp:setProperty name="validate" property="*" />
</jsp:useBean>
<c:if test="${validate.valid == false}">
The input is not valid.
</c:if>In case it matters, my web.xml file starts out like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">I have placed jstl.jar and standard.jar in my webapp's WEB-INF/lib directory. However, when I try to load the page, I get this error message:
org.apache.jasper.JasperException: /myjsp.jsp(60,0) Unable to load class if
I know that many people have asked similar questions, but in each case, the response was to put jstl.jar and standard.jar in WEB-INF/lib and make sure that you're using the proper URI for the taglib, and I think I have done those things correctly. Any help would be greatly appreciated!Thanks for your response! In answer to your questions:
The JRE is 1.4.2_09. I can't use 1.5 (5.0) without upgrading the OS.
I haven't tried it on a PC. I might be able to, but it would take me some time to set everything up.
What follows is taken from Tomcat/logs/localhost_log.2006-10-24.txt. If there is another log file I should be looking in, please let me know. Here is the full stack trace from the log:
2006-10-24 16:58:40 Could not load TagLibraryValidator class org.apache.taglibs.standard.tlv.JstlCoreTLV: EXCEPTION: org.apache.taglibs.standard.tlv.JstlCoreTLV
2006-10-24 16:58:40 Could not load TagExtraInfo class org.apache.taglibs.standard.tei.ImportTEI: org.apache.taglibs.standard.tei.ImportTEI
2006-10-24 16:58:40 Could not load TagExtraInfo class org.apache.taglibs.standard.tei.ForEachTEI: org.apache.taglibs.standard.tei.ForEachTEI
2006-10-24 16:58:40 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /myjsp.jsp(59,0) Unable to load class if
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:428)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:219)
at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:712)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:804)
at org.apache.jasper.compiler.Parser.parse(Parser.java:122)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:199)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:153)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:227)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:553)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
at java.lang.Thread.run(Thread.java:552) -
Looking for Simple JSTL Example
Hi Everyone,
I'm looking for an example of a simple Web application that uses "JavaServer Pages Standard Tag Library" (JSTL) -- that doesn't use JDeveloper!
I have OC4J stand-alone 10.1.3.0.0 on Microsoft Windows XP Professional Version 2002 Service Pack2 with JDK 1.5.0_07
I created and packaged a J2EE application in a EAR file. The EAR file contents:
META-INF/application.xml
frstjstl.warContents of "application.xml"
<?xml version="1.0"?>
<application
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/application_1_4.xsd"
version="1.4">
<module>
<web>
<web-uri>frstjstl.war</web-uri>
<context-root>frstjstl</context-root>
</web>
</module>
</application>Contents of "frstjstl.war"
META-INF/MANIFEST.MF
index.jsp
WEB-INF/lib/standard.jar
WEB-INF/web.xmlContents of "web.xml"
<?xml version="1.0"?>
<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/web-app_2_4.xsd"
version="2.4">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/lib/standard.jar</taglib-location>
</taglib>
</jsp-config>
</web-app>Contents of "index.jsp"
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>Simplest JSTL</title>
</head>
<body>
<h1>Simplest JSTL</h1>
<c:forEach var="httpRequestHeaders" items="${headerValues}">
${httpRequestHeaders.key} = ${httpRequestHeaders.value}
</c:forEach>
</body>
</html>My JSTL implementation comes from here:
http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html
The distribution contains a "standard.jar" file and a "jstl.jar" file (among other things). The "standard.jar" file is included in my WAR (see above) and I have copied the "jstl.jar" file to:
%J2EE_HOME%\jsp\lib\taglibI launch OC4J from the command prompt like this:
java -jar oc4j.jarI deploy my EAR using the following command:
java -jar admin.jar ormi://localhost oc4jadmin xxx -deploy -file frstjstl.ear -deploymentName FirstJSTL -bindWebApp default-web-siteThen I launch my Web browser and enter the following URL:
http://localhost/frstjstlAnd I get the following error message:
500 Internal Server Error
OracleJSP: oracle.jsp.parse.JspParseException: /index.jsp: Line # 8, <c:forEach var="httpRequestHeaders" items="${headerValues}">
Error: Attribute: items is not a valid attribute nameThanks (for reading),
Avi.Thanks Qiang.
Yes, when I copy file "index.jsp" to directory "%J2EE_HOME%\default-web-app\testJstl.jsp" it works.
I use the following URL:
http://localhost:8888/testJstl.jspAnd this is the output I get:
[Format modified to be more suitable to post on this forum.]
Simplest JSTL
CONNECTION = [Ljava.lang.String;@7348e
USER-AGENT = [Ljava.lang.String;@10b8d03
ACCEPT-LANGUAGE = [Ljava.lang.String;@157011e
ACCEPT-ENCODING = [Ljava.lang.String;@10a8143
ACCEPT = [Ljava.lang.String;@ac8360 HOST = [Ljava.lang.String;@1e534cb
[/pre]
But I guess, since the JSTL related JAR files are part of the default Web application, there is no reason it shouldn't work.
That's why you said:
Let us do a sanity test first.So now what?
(And, by the way, thanks for your help.)
Cheers,
Avi.
Message was edited by:
Avi Abrami -
Error While adding JSTL support in JDev 11g
Hi ,
Continuing on my Spring tutorial on http://static.springsource.org/docs/Spring-MVC-step-by-step/
I have added JSTL support in my application. Getting below error:
Error 500--Internal Server Error
java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
at org.springframework.web.servlet.support.JstlUtils.exposeLocalizationContext(JstlUtils.java:97)
at org.springframework.web.servlet.view.JstlView.exposeHelpers(JstlView.java:133)
at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:209)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:257)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1183)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:902)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 27 more
But I have added jstl.jar and standard.jar at both places 1) Tools-> Manage Libraries. Also Deploy by Default is checked. and 2)Application->Project Properties->classpath and libraries and Then I have added individual jars . Also I have added jar directory to be doubly sure. But still the same error.......
Please anyone help......Hi ,
I tried whatever is there in the link and got below error:
<31 Oct, 2011 12:24:49 AM IST> <Error> <J2EE> <BEA-160197> <Unable to load descriptor C:\Users\Nano\AppData\Roaming\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\springapp/META-INF/weblogic-application.xml of module springapp. The error is weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
problem: cvc-complex-type.2.4a: Expected elements 'library-ref@http://xmlns.oracle.com/weblogic/weblogic-application fair-share-request@http://xmlns.oracle.com/weblogic/weblogic-application response-time-request@http://xmlns.oracle.com/weblogic/weblogic-application context-request@http://xmlns.oracle.com/weblogic/weblogic-application max-threads-constraint@http://xmlns.oracle.com/weblogic/weblogic-application min-threads-constraint@http://xmlns.oracle.com/weblogic/weblogic-application capacity@http://xmlns.oracle.com/weblogic/weblogic-application work-manager@http://xmlns.oracle.com/weblogic/weblogic-application component-factory-class-name@http://xmlns.oracle.com/weblogic/weblogic-application application-admin-mode-trigger@http://xmlns.oracle.com/weblogic/weblogic-application session-descriptor@http://xmlns.oracle.com/weblogic/weblogic-application library-context-root-override@http://xmlns.oracle.com/weblogic/weblogic-application prefer-application-packages@http://xmlns.oracle.com/weblogic/weblogic-application prefer-application-resources@http://xmlns.oracle.com/weblogic/weblogic-application fast-swap@http://xmlns.oracle.com/weblogic/weblogic-application coherence-cluster-ref@http://xmlns.oracle.com/weblogic/weblogic-application' instead of 'container-descriptor@http://xmlns.oracle.com/weblogic/weblogic-application' here in element weblogic-application@http://xmlns.oracle.com/weblogic/weblogic-application:<null>
at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:245)
at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:231)
at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:155)
at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:323)
at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:788)
at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescriptorBean(AbstractDescriptorLoader2.java:409)
at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBeanWithoutPlan(AbstractDescriptorLoader2.java:759)
at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBean(AbstractDescriptorLoader2.java:768)
at weblogic.application.ApplicationDescriptor.getWeblogicApplicationDescriptor(ApplicationDescriptor.java:329)
at weblogic.application.internal.EarDeploymentFactory.findOrCreateComponentMBeans(EarDeploymentFactory.java:181)
at weblogic.application.internal.MBeanFactoryImpl.findOrCreateComponentMBeans(MBeanFactoryImpl.java:48)
at weblogic.application.internal.MBeanFactoryImpl.createComponentMBeans(MBeanFactoryImpl.java:110)
at weblogic.application.internal.MBeanFactoryImpl.initializeMBeans(MBeanFactoryImpl.java:76)
at weblogic.management.deploy.internal.MBeanConverter.createApplicationMBean(MBeanConverter.java:89)
at weblogic.management.deploy.internal.MBeanConverter.createApplicationForAppDeployment(MBeanConverter.java:67)
at weblogic.management.deploy.internal.MBeanConverter.setupNew81MBean(MBeanConverter.java:315)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.compatibilityProcessor(ActivateOperation.java:81)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.setupPrepare(AbstractOperation.java:295)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:97)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
.>
<31 Oct, 2011 12:24:49 AM IST> <Error> <Deployer> <BEA-149605> <Failed to create App/Comp mbeans for AppDeploymentMBean springapp. Error - weblogic.management.DeploymentException: VALIDATION PROBLEMS WERE FOUND
problem: cvc-complex-type.2.4a: Expected elements 'library-ref@http://xmlns.oracle.com/weblogic/weblogic-application fair-share-request@http://xmlns.oracle.com/weblogic/weblogic-application response-time-request@http://xmlns.oracle.com/weblogic/weblogic-application context-request@http://xmlns.oracle.com/weblogic/weblogic-application max-threads-constraint@http://xmlns.oracle.com/weblogic/weblogic-application min-threads-constraint@http://xmlns.oracle.com/weblogic/weblogic-application capacity@http://xmlns.oracle.com/weblogic/weblogic-application work-manager@http://xmlns.oracle.com/weblogic/weblogic-application component-factory-class-name@http://xmlns.oracle.com/weblogic/weblogic-application application-admin-mode-trigger@http://xmlns.oracle.com/weblogic/weblogic-application session-descriptor@http://xmlns.oracle.com/weblogic/weblogic-application library-context-root-override@http://xmlns.oracle.com/weblogic/weblogic-application prefer-application-packages@http://xmlns.oracle.com/weblogic/weblogic-application prefer-application-resources@http://xmlns.oracle.com/weblogic/weblogic-application fast-swap@http://xmlns.oracle.com/weblogic/weblogic-application coherence-cluster-ref@http://xmlns.oracle.com/weblogic/weblogic-application' instead of 'container-descriptor@http://xmlns.oracle.com/weblogic/weblogic-application' here in element weblogic-application@http://xmlns.oracle.com/weblogic/weblogic-application:<null>.
weblogic.management.DeploymentException: VALIDATION PROBLEMS WERE FOUND
problem: cvc-complex-type.2.4a: Expected elements 'library-ref@http://xmlns.oracle.com/weblogic/weblogic-application fair-share-request@http://xmlns.oracle.com/weblogic/weblogic-application response-time-request@http://xmlns.oracle.com/weblogic/weblogic-application context-request@http://xmlns.oracle.com/weblogic/weblogic-application max-threads-constraint@http://xmlns.oracle.com/weblogic/weblogic-application min-threads-constraint@http://xmlns.oracle.com/weblogic/weblogic-application capacity@http://xmlns.oracle.com/weblogic/weblogic-application work-manager@http://xmlns.oracle.com/weblogic/weblogic-application component-factory-class-name@http://xmlns.oracle.com/weblogic/weblogic-application application-admin-mode-trigger@http://xmlns.oracle.com/weblogic/weblogic-application session-descriptor@http://xmlns.oracle.com/weblogic/weblogic-application library-context-root-override@http://xmlns.oracle.com/weblogic/weblogic-application prefer-application-packages@http://xmlns.oracle.com/weblogic/weblogic-application prefer-application-resources@http://xmlns.oracle.com/weblogic/weblogic-application fast-swap@http://xmlns.oracle.com/weblogic/weblogic-application coherence-cluster-ref@http://xmlns.oracle.com/weblogic/weblogic-application' instead of 'container-descriptor@http://xmlns.oracle.com/weblogic/weblogic-application' here in element weblogic-application@http://xmlns.oracle.com/weblogic/weblogic-application:<null>
at weblogic.application.internal.EarDeploymentFactory.findOrCreateComponentMBeans(EarDeploymentFactory.java:193)
at weblogic.application.internal.MBeanFactoryImpl.findOrCreateComponentMBeans(MBeanFactoryImpl.java:48)
at weblogic.application.internal.MBeanFactoryImpl.createComponentMBeans(MBeanFactoryImpl.java:110)
at weblogic.application.internal.MBeanFactoryImpl.initializeMBeans(MBeanFactoryImpl.java:76)
at weblogic.management.deploy.internal.MBeanConverter.createApplicationMBean(MBeanConverter.java:89)
Truncated. see log file for complete stacktrace
Caused By: weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
problem: cvc-complex-type.2.4a: Expected elements 'library-ref@http://xmlns.oracle.com/weblogic/weblogic-application fair-share-request@http://xmlns.oracle.com/weblogic/weblogic-application response-time-request@http://xmlns.oracle.com/weblogic/weblogic-application context-request@http://xmlns.oracle.com/weblogic/weblogic-application max-threads-constraint@http://xmlns.oracle.com/weblogic/weblogic-application min-threads-constraint@http://xmlns.oracle.com/weblogic/weblogic-application capacity@http://xmlns.oracle.com/weblogic/weblogic-application work-manager@http://xmlns.oracle.com/weblogic/weblogic-application component-factory-class-name@http://xmlns.oracle.com/weblogic/weblogic-application application-admin-mode-trigger@http://xmlns.oracle.com/weblogic/weblogic-application session-descriptor@http://xmlns.oracle.com/weblogic/weblogic-application library-context-root-override@http://xmlns.oracle.com/weblogic/weblogic-application prefer-application-packages@http://xmlns.oracle.com/weblogic/weblogic-application prefer-application-resources@http://xmlns.oracle.com/weblogic/weblogic-application fast-swap@http://xmlns.oracle.com/weblogic/weblogic-application coherence-cluster-ref@http://xmlns.oracle.com/weblogic/weblogic-application' instead of 'container-descriptor@http://xmlns.oracle.com/weblogic/weblogic-application' here in element weblogic-application@http://xmlns.oracle.com/weblogic/weblogic-application:<null>
at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:245)
at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:231)
at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:155)
at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:323)
at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:788)
Truncated. see log file for complete stacktrace
>
<31 Oct, 2011 12:24:49 AM IST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1320000889396' for task '8'. Error is: 'weblogic.management.DeploymentException: VALIDATION PROBLEMS WERE FOUND
problem: cvc-complex-type.2.4a: Expected elements 'library-ref@http://xmlns.oracle.com/weblogic/weblogic-application fair-share-request@http://xmlns.oracle.com/weblogic/weblogic-application response-time-request@http://xmlns.oracle.com/weblogic/weblogic-application context-request@http://xmlns.oracle.com/weblogic/weblogic-application max-threads-constraint@http://xmlns.oracle.com/weblogic/weblogic-application min-threads-constraint@http://xmlns.oracle.com/weblogic/weblogic-application capacity@http://xmlns.oracle.com/weblogic/weblogic-application work-manager@http://xmlns.oracle.com/weblogic/weblogic-application component-factory-class-name@http://xmlns.oracle.com/weblogic/weblogic-application application-admin-mode-trigger@http://xmlns.oracle.com/weblogic/weblogic-application session-descriptor@http://xmlns.oracle.com/weblogic/weblogic-application library-context-root-override@http://xmlns.oracle.com/weblogic/weblogic-application prefer-application-packages@http://xmlns.oracle.com/weblogic/weblogic-application prefer-application-resources@http://xmlns.oracle.com/weblogic/weblogic-application fast-swap@http://xmlns.oracle.com/weblogic/weblogic-application coherence-cluster-ref@http://xmlns.oracle.com/weblogic/weblogic-application' instead of 'container-descriptor@http://xmlns.oracle.com/weblogic/weblogic-application' here in element weblogic-application@http://xmlns.oracle.com/weblogic/weblogic-application:<null>'
weblogic.management.DeploymentException: VALIDATION PROBLEMS WERE FOUND
problem: cvc-complex-type.2.4a: Expected elements 'library-ref@http://xmlns.oracle.com/weblogic/weblogic-application fair-share-request@http://xmlns.oracle.com/weblogic/weblogic-application response-time-request@http://xmlns.oracle.com/weblogic/weblogic-application context-request@http://xmlns.oracle.com/weblogic/weblogic-application max-threads-constraint@http://xmlns.oracle.com/weblogic/weblogic-application min-threads-constraint@http://xmlns.oracle.com/weblogic/weblogic-application capacity@http://xmlns.oracle.com/weblogic/weblogic-application work-manager@http://xmlns.oracle.com/weblogic/weblogic-application component-factory-class-name@http://xmlns.oracle.com/weblogic/weblogic-application application-admin-mode-trigger@http://xmlns.oracle.com/weblogic/weblogic-application session-descriptor@http://xmlns.oracle.com/weblogic/weblogic-application library-context-root-override@http://xmlns.oracle.com/weblogic/weblogic-application prefer-application-packages@http://xmlns.oracle.com/weblogic/weblogic-application prefer-application-resources@http://xmlns.oracle.com/weblogic/weblogic-application fast-swap@http://xmlns.oracle.com/weblogic/weblogic-application coherence-cluster-ref@http://xmlns.oracle.com/weblogic/weblogic-application' instead of 'container-descriptor@http://xmlns.oracle.com/weblogic/weblogic-application' here in element weblogic-application@http://xmlns.oracle.com/weblogic/weblogic-application:<null>
at weblogic.application.internal.EarDeploymentFactory.findOrCreateComponentMBeans(EarDeploymentFactory.java:193)
at weblogic.application.internal.MBeanFactoryImpl.findOrCreateComponentMBeans(MBeanFactoryImpl.java:48)
at weblogic.application.internal.MBeanFactoryImpl.createComponentMBeans(MBeanFactoryImpl.java:110)
at weblogic.application.internal.MBeanFactoryImpl.initializeMBeans(MBeanFactoryImpl.java:76)
at weblogic.management.deploy.internal.MBeanConverter.createApplicationMBean(MBeanConverter.java:89)
Truncated. see log file for complete stacktrace
Caused By: weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
problem: cvc-complex-type.2.4a: Expected elements 'library-ref@http://xmlns.oracle.com/weblogic/weblogic-application fair-share-request@http://xmlns.oracle.com/weblogic/weblogic-application response-time-request@http://xmlns.oracle.com/weblogic/weblogic-application context-request@http://xmlns.oracle.com/weblogic/weblogic-application max-threads-constraint@http://xmlns.oracle.com/weblogic/weblogic-application min-threads-constraint@http://xmlns.oracle.com/weblogic/weblogic-application capacity@http://xmlns.oracle.com/weblogic/weblogic-application work-manager@http://xmlns.oracle.com/weblogic/weblogic-application component-factory-class-name@http://xmlns.oracle.com/weblogic/weblogic-application application-admin-mode-trigger@http://xmlns.oracle.com/weblogic/weblogic-application session-descriptor@http://xmlns.oracle.com/weblogic/weblogic-application library-context-root-override@http://xmlns.oracle.com/weblogic/weblogic-application prefer-application-packages@http://xmlns.oracle.com/weblogic/weblogic-application prefer-application-resources@http://xmlns.oracle.com/weblogic/weblogic-application fast-swap@http://xmlns.oracle.com/weblogic/weblogic-application coherence-cluster-ref@http://xmlns.oracle.com/weblogic/weblogic-application' instead of 'container-descriptor@http://xmlns.oracle.com/weblogic/weblogic-application' here in element weblogic-application@http://xmlns.oracle.com/weblogic/weblogic-application:<null>
at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:245)
at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:231)
at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:155)
at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:323)
at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:788)
Truncated. see log file for complete stacktrace
>
<31 Oct, 2011 12:24:49 AM IST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'springapp'.>
<31 Oct, 2011 12:24:49 AM IST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.management.DeploymentException: VALIDATION PROBLEMS WERE FOUND
problem: cvc-complex-type.2.4a: Expected elements 'library-ref@http://xmlns.oracle.com/weblogic/weblogic-application fair-share-request@http://xmlns.oracle.com/weblogic/weblogic-application response-time-request@http://xmlns.oracle.com/weblogic/weblogic-application context-request@http://xmlns.oracle.com/weblogic/weblogic-application max-threads-constraint@http://xmlns.oracle.com/weblogic/weblogic-application min-threads-constraint@http://xmlns.oracle.com/weblogic/weblogic-application capacity@http://xmlns.oracle.com/weblogic/weblogic-application work-manager@http://xmlns.oracle.com/weblogic/weblogic-application component-factory-class-name@http://xmlns.oracle.com/weblogic/weblogic-application application-admin-mode-trigger@http://xmlns.oracle.com/weblogic/weblogic-application session-descriptor@http://xmlns.oracle.com/weblogic/weblogic-application library-context-root-override@http://xmlns.oracle.com/weblogic/weblogic-application prefer-application-packages@http://xmlns.oracle.com/weblogic/weblogic-application prefer-application-resources@http://xmlns.oracle.com/weblogic/weblogic-application fast-swap@http://xmlns.oracle.com/weblogic/weblogic-application coherence-cluster-ref@http://xmlns.oracle.com/weblogic/weblogic-application' instead of 'container-descriptor@http://xmlns.oracle.com/weblogic/weblogic-application' here in element weblogic-application@http://xmlns.oracle.com/weblogic/weblogic-application:<null>
at weblogic.application.internal.EarDeploymentFactory.findOrCreateComponentMBeans(EarDeploymentFactory.java:193)
at weblogic.application.internal.MBeanFactoryImpl.findOrCreateComponentMBeans(MBeanFactoryImpl.java:48)
at weblogic.application.internal.MBeanFactoryImpl.createComponentMBeans(MBeanFactoryImpl.java:110)
at weblogic.application.internal.MBeanFactoryImpl.initializeMBeans(MBeanFactoryImpl.java:76)
at weblogic.management.deploy.internal.MBeanConverter.createApplicationMBean(MBeanConverter.java:89)
Truncated. see log file for complete stacktrace
Caused By: weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
problem: cvc-complex-type.2.4a: Expected elements 'library-ref@http://xmlns.oracle.com/weblogic/weblogic-application fair-share-request@http://xmlns.oracle.com/weblogic/weblogic-application response-time-request@http://xmlns.oracle.com/weblogic/weblogic-application context-request@http://xmlns.oracle.com/weblogic/weblogic-application max-threads-constraint@http://xmlns.oracle.com/weblogic/weblogic-application min-threads-constraint@http://xmlns.oracle.com/weblogic/weblogic-application capacity@http://xmlns.oracle.com/weblogic/weblogic-application work-manager@http://xmlns.oracle.com/weblogic/weblogic-application component-factory-class-name@http://xmlns.oracle.com/weblogic/weblogic-application application-admin-mode-trigger@http://xmlns.oracle.com/weblogic/weblogic-application session-descriptor@http://xmlns.oracle.com/weblogic/weblogic-application library-context-root-override@http://xmlns.oracle.com/weblogic/weblogic-application prefer-application-packages@http://xmlns.oracle.com/weblogic/weblogic-application prefer-application-resources@http://xmlns.oracle.com/weblogic/weblogic-application fast-swap@http://xmlns.oracle.com/weblogic/weblogic-application coherence-cluster-ref@http://xmlns.oracle.com/weblogic/weblogic-application' instead of 'container-descriptor@http://xmlns.oracle.com/weblogic/weblogic-application' here in element weblogic-application@http://xmlns.oracle.com/weblogic/weblogic-application:<null>
at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:245)
at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:231)
at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:155)
at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:323)
at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:788)
Truncated. see log file for complete stacktrace
>
[12:24:49 AM] #### Deployment incomplete. ####
[12:24:49 AM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
#### Cannot run application springapp due to error deploying to IntegratedWebLogicServer.
[Application springapp stopped and undeployed from Server Instance IntegratedWebLogicServer]
Also according to the link in step 6, I need to modify weblogic.xml to add given entries. So I add the required lines in weblogic.xml found at C:\Users\Nano\AppData\Roaming\JDeveloper\system11.1.1.3.37.56.60\o.j2ee\drs\springapp\NewProjWebApp.war\WEB-INF
But when I try to run application, my changes are overwritten and it again contains whatever it had before my changes.
Can you please tell me am I editing the right file and why its contents are overwritten? -
Retaining of values in JSP while using JSTL
Dear All,
I have an application using the struts framework, wherein I am facing a problem.
Here goes the problem " In my JSP's I have multiselect, the JSTL tags works fine when all the server side validations are done. But I get a problem when an error(server side validation error) occurs, I have to retain all the multiple values selected in the Multiselect box.
Can anyone suggest me best way to retain the multiple values.
E.g. My multiselect populates 5 values
A
B
C
D
E
As a end user I select "B, C,E", and a server side validation error occurs I have to keep the values "B, C, E" selected in the above list of 5 values using JSTL
Thanking you in anticipation.
regards,
Mohan.Dear Friend,
The control I am placing(multi select) has the data type in the form as String[],
The validation error(server side) I was talking about is: I have 5 fields in JSP, in one of the 5 fields I have a title, which is unique in the database, if the end user enters an already existing title, then all the values previously (entered, selected) for rest of the controls should be retained and an error message from application resources is populated about the title duplication.
Here I will show the entered values in text box and also the multi-selects, so using JSTL, I want a way out to retain the previously selected values....
In my JSP for the control I say <input type="select" property="propertyname" multiple="true">
of struts...
Thank you
Mohan. -
Problem in the jsp, jstl and java script.
Hi Friends,
I am having one jsp which allows user(Could you please refer to code which is written in my jsp) to enter his username and password i want to get the password in the same jsp and want it to be passed to the custom tag without sending request to the server.Please give me an idea.Thanks in advance.
This is the text field which allows a password.
<INPUT type="password" name="password" size="10" maxlength="29" onblur="chkpwd()" onfocus="this.autocomplete=false" >
and this is the anchor tag which refers as LOGIN BUTTON
<IMG height=19 src="images/submit1.gif" width=106 border=0>
when user clicks on LOGIN BUTTON i am calling one javascript function LOGIN(PASSWORD:) to check the validation if the validation is success then i want to get the password in the same function which is entered .
This is ok i can get the password by "document.formName.password.value" then i need to pass this value to the jstl tag which is our own tag as shown below.
<prefix:tagname value="PASSWORD which is having in the javascript variable".
Please help me .
Quick reply is thankfull.
Edited by: bharathpolanki on Apr 20, 2008 1:55 AM
Edited by: bharathpolanki on Apr 20, 2008 2:55 AMthat's correct. You can use the below code for AJAX request.
<script type="text/javascript">
var httpObject = getHTTPObject();
//create XMLHttpRequest object
function getHTTPObject() {
var xmlhttp;
if (window.XMLHttpRequest) // if Mozilla, Safari etc
xmlhttp = new XMLHttpRequest();
else if (window.ActiveXObject){ // if IE
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
catch ( e ){
try{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
catch ( e ){}
return xmlhttp;
//define the function to send the request
function sendRequest(){
var currDesc = document.getElementById("description").value;
var URL = "manageMaintAction.do"; //action mapping in your struts-config
var queryString = "currDesc="+escape(currDesc); //get the currDesc value in your action class like request.getParameter("currDesc")
httpObject.open( "Post", URL, true );
httpObject.onreadystatechange = cbFn;
httpObject.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded");
httpObject.send(queryString);
//callback fn
function cbFn() {
if (httpObject.readyState == 4)
if (httpObject.status == 200)
var result = httpObject.responseText;
alert(result);
</script> -
Hi,
I am stuck with validation on same jsp page:
Here is the detail:
I have a couple of input fields in form, and if users enter wrong name and id
the validation error will be shown on the same jsp page.
I know there is no problem if using struts validation function.
But for my case, is just simple jsp without other component replying on.
How to achieve this?
Actually the original validation logic is done by jave script
which collected all error message into formated variable,
The popup window for error message display will be shown once users click submit button
Any help?use another jsp/servlet to do the logic on the
validating then on the
input jsp.it must forward to your input form jsp so
you can repopulate the values of the fields.. you can
have the following codes:
validator.jsp:
//validate here
<%if(success){%>
<jsp:forward page="success.jsp"/>
<%}else{%>
<jsp:forward page="input.jsp?err=error"/>
<%}%>input.jsp
<%
String err =
request.getParameter("err")!=null?request.getParameter
("err"):"none";
String field1 =
request.getParameter("feild1")!=null?request.getParame
ter("feild1"):"";
if(!err.equals("none")){
%>
<%=err%>
<%}%>
<input type="text" value="<%=field1%>"
name="feild1"/>
Raw scriptlet code? When you could and should be using JSTL? Bad idea.
% -
Hi All,
When I run the following JSP
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
<%@ page import="java.util.*,com.dpbabu.*"%>
<html><head><title></title></head>
<body>
<c:set var="rowsPerPage" value="10" scope="session"/>
<c:set var="categories" value="${rows}"/>
<%int rowNum=categories.size();%>
<c:set var="a" value="rowNum/rowsPerPage">
<fmt:formatNumber maxFractionDigit="0"/>
</c:set>
</body>
</html>
I am getting the following Error: Please solve my Problem. I put all required .jar files in the Application directory.
org.apache.jasper.JasperException: /PageView.jsp(9,0) According to TLD or attribute directive in tag file, attribute value does not accept any expressions
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:150)
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:941)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:696)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Validator.validate(Validator.java:1475)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:214)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.dpbabu.Search.doPost(Search.java:57)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
What is the Actual problem? is there any syntax error?
Please the correct the syntax if wrong.
Thanks in avance.
Prasad.This is the standard error message you see when you use JSTL1.0 with a JSP2.0 container like Tomcat 5.
With Tomcat 5 you should be using JSTL1.1
For JSTL1.1 you need to use the following import:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
(note the subtle addition of the "jsp" into the url.)
Also make sure your web.xml file declares itself as being version 2.4
http://forum.java.sun.com/thread.jspa?threadID=629437&tstart=0 -
Hi , I am using JSTL to connect to MYSQL DB , but it fails ,
any one could help ,
according to documentation I wrote the following tag (I am not sure about the value of the attribute "url" ):
<ui:panelGroup binding="#{Main.groupPanel1}" id="groupPanel1" style="position: absolute; left: 24px; top: 24px; width: 552px; height: 264px">
<c:out value="TEST JSTL"/>
<sql:setDataSource
var="categoriesRow"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://127.0.0.1:3306/used"
user="root"
password="xxxx">
</sql:setDataSource>
<sql:query dataSource="${categoriesRow}" var="categories">
SELECT * FROM categories
</sql:query>
<c:forEach var="columnName" items="${categories.columnNames}">
<th><c:out value="${columnName}"/></th>
</c:forEach>
</ui:panelGroup>andgot the following Exception :
Exception Handler
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
/Main.jsp(21,85) According to TLD or attribute directive in tag file, attribute dataSource 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(Validator.java:945)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:700)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1445)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2167)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2217)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:720)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1445)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2167)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2217)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:720)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1445)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2167)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2217)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:720)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1445)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2167)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2217)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:720)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1445)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2167)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2217)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:720)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1445)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2167)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2217)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:720)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1445)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2167)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2217)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:399)
org.apache.jasper.compiler.Node$JspRoot.accept(Node.java:529)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2167)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2217)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2223)
org.apache.jasper.compiler.Node$Root.accept(Node.java:460)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2167)
org.apache.jasper.compiler.Validator.validate(Validator.java:1479)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:225)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:500)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:481)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:469)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:516)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:307)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247)
javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
sun.reflect.GeneratedMethodAccessor739.invoke( Unknown Source )
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
java.security.AccessController.doPrivileged(AccessController.java:-2)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
java.security.AccessController.doPrivileged(AccessController.java:-2)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:723)
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:482)
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:417)
org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatcher.java:80)
org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(ApplicationDispatcher.java:95)
java.security.AccessController.doPrivileged(AccessController.java:-2)
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:313)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:311)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
java.security.AccessController.doPrivileged(AccessController.java:-2)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
java.security.AccessController.doPrivileged(AccessController.java:-2)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210)
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
java.security.AccessController.doPrivileged(AccessController.java:-2)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189)
com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604)
com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475)
com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371)
com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264)
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281)
com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83)
Exception Details: javax.faces.FacesException
org.apache.jasper.JasperException: /Main.jsp(21,85) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
Possible Source of Error:
Class Name: com.sun.faces.context.ExternalContextImpl
File Name: ExternalContextImpl.java
Method Name: dispatch
Line Number: 327
Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.
Stack Trace:
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:327)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:311)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
java.security.AccessController.doPrivileged(AccessController.java:-2)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
java.security.AccessController.doPrivileged(AccessController.java:-2)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210)
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
java.security.AccessController.doPrivileged(AccessController.java:-2)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189)
com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604)
com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475)
com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371)
com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264)
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281)
com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83)
Exception Details: com.sun.rave.web.ui.appbase.ApplicationException
org.apache.jasper.JasperException: /Main.jsp(21,85) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
Possible Source of Error:
Class Name: com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl
File Name: ViewHandlerImpl.java
Method Name: destroy
Line Number: 601
Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.
Stack Trace:
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.destroy(ViewHandlerImpl.java:601)
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:316)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
java.security.AccessController.doPrivileged(AccessController.java:-2)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
java.security.AccessController.doPrivileged(AccessController.java:-2)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210)
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
java.security.AccessController.doPrivileged(AccessController.java:-2)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189)
com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604)
com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475)
com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371)
com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264)
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281)
com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83)unable to rectify the error........ tried lot but all in vain...still trying........
my current code is:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql_rt" %>
<sql:setDataSource var="datasource" driver="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:microsoft:sqlserver://SYS57:1433;databaseName=sree" user="sa"
password="dfgdfg"/>
<sql:query var="res" dataSource="${datasource}">
SELECT * FROM books
</sql:query>
<html>
<head>
<title>A First JSP Database</title>
</head>
<body>
<table border="1">
<tr>
<td>id</td><td>title</td><td>price</td>
</tr>
<c:forEach items="${res.rows}" var="row">
<tr>
<td><c:out value="${row.id}" /></td>
<td><c:out value="${row.name}" /></td>
<td><c:out value="${row.author}" /></td>
</tr>
</c:forEach>
</table>
</body>
</html>Thanks,
Akshatha -
I want to subtract current Timestamp from other Timestamp which is from Database, but follwing error occured
org.apache.jasper.JasperException: /jstl_online_user.jsp(18,2) The function Timestamp must be used with a prefix when a default namespace is not specified
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:150)
org.apache.jasper.compiler.Validator$1FVVisitor.visit(Validator.java:1229)
org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:122)
org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:193)
org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:234)My code
<%@ page import="java.sql.*,javax.sql.*,javax.naming.*" isELIgnored ="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<sql:query var="rs_online" dataSource="helpdeskJNDIRef">
Select u.user_id,user_ip,user_timestamp,user_what_action,user_what_arg1,user_name,user_display_name from user u , whos_online w where u.user_id=w.user_id
</sql:query>
<html>
<head>
<title>DB Test</title>
</head>
<body>
<h2>Results</h2>
<c:out value="${1 + 2 + 3}" />
<c:forEach var="row" items="${rs.rows}">
Text Message: <c:out value="${i.user_name}"/><br>
<c:set var="logged" value="${(new java.sql.Timestamp(new java.util.Date().getTime())).getTime() - row.user_timestamp}" scope="page" />
<c:out value="${logged}" />
</c:forEach>
</body>
</html>Edited by: sagar_birari on 7 Jun, 2008 12:02 PMEL is not a scripting language, just an Expression Language, so you can't create timestamps with it.
You probably shouldn't be doing this logic in the JSP anyway. Try moving the logic to beans. The code might look something like this:
<%@ page isELIgnored ="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!-- Create a bean then controls getting the user(s) from the database -->
<jsp:useBean id="userLog" class="login.UserLog" scope="request" scope="page">
<!-- Use a public void setUserName(String) method to set the w.user_id.
This method may execute the SQL and store results
-->
<jsp:setProperty name="user" property="userName" value="w.user_id"/>
</jsp:useBean>
<!-- Get a List<User> of all the logged in users that match the name given previously.
If the setUserName method didn't execute the SQL, then the method
public List getAllUsers(void) method this line calls should.
-->
<c:set var="usersLoggedIn" value="${userLog.allUsers}" scope="page" />
<html>
<head>
<title>DB Test</title>
</head>
<body>
<h2>Results</h2>
<c:out value="${1 + 2 + 3}" />
<!-- Iterate over the List<User> of users. Objects in the list are of another bean type (login.User) -->
<c:forEach var="user" items="${usersLoggedIn}">
<!-- Call login.User#public String getUserName(void) method -->
Text Message: <c:out value="${user.userName}"/><br>
<!-- Call login.User#public String getLoggedTime(void) method which takes the current timestamp
and subtracts the time the user logged in, and converts it back to a String for display
-->
<c:out value="${user.loggedTime}" />
</c:forEach>
</body>
</html>Of course, you could try doing the timestamp math in a scriptlet <% ... %> and storing the value in the pageContext. -
I am using JSTL to display data in an editable menu. The data is retrieved from a database and the user may change it if required. The problem is that I get a blank page inside the forEach tag.
%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<sql:query var="rs" dataSource="jdbc/agenda">
SELECT * FROM cardapios WHERE username="${pageContext.request.remoteUser}"
</sql:query>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form action="../ChangeMenu" method="POST">
Everything I write here I can see!!!
<c:forEach var="r" items="${rs.rows}">
Restaurante: <input type="text" name="restaurante" value="${r.restaurante}" /> I cant see it!!
Here I have many <input type="text" ..... etc />
</c:forEach>
<input type="submit" value="Salvar" />
</form>
</body>
</html>Well, if I remove the form action, it works properly. So, the data is being retrieved from the database.
Also, do I really have to use <c:forEach> since it will always retrieve just one line from the table? Is there any other way I can get the data from "rs" ?
Thanks!If you know for certain there is exactly one and only ever one row returned, then you can just access it directly:
<c:set var="r" value="${rs.rows[0]}"/>With regards to the query, it would probably be better using parameter rather than the variable directly:
<sql:query var="rs" dataSource="jdbc/agenda">
SELECT * FROM cardapios WHERE username= ?
<sql:param value="${pageContext.request.remoteUser}"/>
</sql:query>I don't think that would change the functionality, but it would prevent SQL injection attacks.
I don't see how removing the form action would change the display of the html page.
My suggestion would be to view source on the generated HTML page, and see what is being produced by running the page.
Did the query return the results that you wanted? Is it generating valid HTML?
Cheers,
evnafets
Maybe you are looking for
-
Hiding some fields from ALV report
Hi All, I want to know if there is way to hide certain fields in ALV for some users only and not for others? If I use the option NO_OUT = 'X' it will not be displayed in the list but the user can see the in the Layout option fields but if use NO_OUT
-
Best way to Insert Millions records in SQL Azure on daily basis?
I am maintaining millions of records in Sql Server 2008 R2 and now i am intended to migrate these on SQL Azure. In existing system with SQL Server 2008 R2, few SSIS packages and Stored Procedures are firstly truncate the existing records and then per
-
Dynamic text boxes, font size issues
I have created a dynamic text box and an input text box. I have produced code that replicates whatever is typed in the input box to display in the dynamic box along with a date and time stamp once a button is clicked. This all works fine, except for
-
Lazy load easy implementation?
I'm trying to add lazy loading to a page I created in muse so that when someone views the page on their phone it does not load all 170mb worth of images that are on the page unless the user scrolls down through the entire page- is there an easy way t
-
Hi Archers: I've used this distro since 3 years in workstations and my netbook Toshiba NB200 and everything works fine. Now the challenge is to build a cluster with 3 server machines. Everyone is a DELL PowerEdge The Master: PowerEdge R710 The Node: