• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL validation error  RSS feed

 
anandkrishna anand
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I am using custom jstl tag in my jspf file as follows.

<user:newUrl dest="${object.url}" var="sendUrl">
<c:param name="userName" value="${object.name}" />
</user:newUrl>


but the problem is that while running, i am getting the following validation error.

SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: <h3>Validation error messages from TagLibraryValidator for c in

blahblahblah.....
</h3><p>30: Invalid use of "param" tag outside legitimate parent tag</p><p>

I am not sure what is causing the problem.

Any help will be appreciated.


Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66154
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anandkrishna anand wrote:I am using custom jstl tag

That makes no sense. The JSTL is a standard tag library.

Either you are using the JSTL, or you are creating your own custom tag. There's no such thing as a "JSTL custom tag".

That said, your problem is that you are trying to nest a <c:param> tag within your own custom tag. That won't work. <c:param> must be nested within a JSTL tag for which it is defiend.
 
anandkrishna anand
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
thanks for reply Bear Bibeault ,

but this code works perfectly fine in jstl 1.1.
It is throwing error in 1.2 only.
This was an existing code which was working perfectly fine.
once we upgraded to Tomcat 6 and jstl 1.2 , the problems started.
Any idea?

Thanks
 
anandkrishna anand
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And our java class implements org.apache.taglibs.standard.tag.common.core.ParamParent and extends necessary java classes related with tagsupport.
My doubt is that, the reason might be some jar file mismatch.


Thanks
 
anandkrishna anand
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I resolved the issue by creating a new wrapper class which extends param tag and using this new tag in place of c:param.
I think the issue was that JSTL 1.2 is having more strict validation compared to earlier versions..This validations can be bypassed by using a new wrapper class.

Thanks
Vinod
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!