Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tag Library validation failing for Choose tag

 
Ragavendran Baskaran
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

My web application is getting migrated to Jboss 5.1 from weblogic 8.1.

There are many JSP pages where we have some HTML tags directly under choose tag(see the sample JSP below) and it used to get evaluated with weblogic 8.1. However if the same app is deployed in jboss and accessed i'm getting the below error

[java] 14:33:02,187 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
[java] org.apache.jasper.JasperException: <h3>Validation error messages from TagLibraryValidator for c in /test8.jsp</h3><p>14: Illegal text inside "c:choose" tag: "<b>A
ler...".</p><p>14: Illegal text inside "c:choose" tag: "</b>...".</p>
[java] at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
[java] at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
[java] at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:74)
[java] at org.apache.jasper.compiler.Validator.validateXmlView(Validator.java:1795)
[java] at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1741)

JBoss version used - 5.1



When i moved the HTML tags outside the choose tag then it is working.



Is there any mandate not to keep html tags inside choose tag. Please help.

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64980
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ragavendran Baskaran wrote:Is there any mandate not to keep html tags inside choose tag.

No. HTML markup is invisible to the JSP processor.

Did you by any chance put either of servlet-api.jar or jsp-api.jar into WEB-INF/lib? Doing so is wrong, and frequently manifests itself as befuddling errors in tag libraries.
 
Ragavendran Baskaran
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear for responding.

I cross checked my ear file and there is no servlet-api or jsp-api jars in it, however i found that standard.jar was packaged in it. I removed it and retested the application. But no luck.

Is there anything else i can check ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64980
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
standard is necessary for the JSTL.
 
Ragavendran Baskaran
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Removing standard.jar didn't made any difference to my application. I was still able to access the JSP's which uses JSTL.

Is there anything else which can affect this ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64980
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure. As this is in the JBoss environment, I'm going to move this to the JBoss forum for those that know more about JBoss to look at.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64980
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ragavendran Baskaran wrote:Removing standard.jar didn't made any difference to my application. I was still able to access the JSP's which uses JSTL.

That's suspicious. It means you might have conflicting jars. I'd go through the jars in your app and make sure you know what each one is doing there.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I responding from memory (I don't have my example apps with me) but from what I recall, you need to package standard.jar in your WAR but you should not install the jstl.jar (JBoss AS supplies it).

It does sound like you are picking up a stray standard.jar from somewhere. Check you CLASSPATH env var (by the way, I recommend not setting that env var, doing so often causes surprises). If that doesn't help, add the "-verbose:class" option to the java command line (in run.conf.bat on windows). This option tells you each class loaded and the JAR it came from. When you run your app you should see the JAR the standard classes are being loaded from.
 
Ragavendran Baskaran
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear/Peter, Thanks for your time. To rule out the possibility of conflicting jar's i have created a tiny web application and deployed it.

I have 2 test pages in it

test.jsp below (When this page is accessed it fails with the same error what i posted earlier)


test1.jsp below (If this page is accessed it works fine)

I also tried enabling the verbose logging, i have enclosed the output.

[Loaded org.apache.taglibs.standard.tag.common.core.ChooseTag from jar:file:/C:/jboss_eap/jboss-eap-5.1/jboss-as/server/web/deploy/jbossweb.sar/jstl.jar!/]

Note: I tested by creating a war file which contains 2 JSP files, web.xml and no jar files in it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic