Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hi..Why is it not working?

 
khushhal yadav
Ranch Hand
Posts: 242
Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there some mean, I can make this code runnable.
One thing is sure I don't want to use <%= request.getParameter("class")%>and${param.age} as a body to <xut>
i.e.


Can I make it runnable without doing that.



Why does it not work for default='<%= request.getParameter("class")%>and${param.age}'?
While it does work for default='${param.class} and ${param.age}'

Here is what I am getting on executing it.

Request org.apache.coyote.tomcat5.CoyoteRequestFacade@1ca7841 initialized at Wed Aug 22 00:43:14 IST 2007
jsp501.jsp is created
jsp501.jsp is initialised
Attribute javax.servlet.error.exception with value org.apache.jasper.JasperException: /jsp501.jsp(19,41) attribute for %>' is not properly terminated added to request org.apache.coyote.tomcat5.CoyoteRequestFacade@1ca7841 at Wed Aug 22 00:43:1
4 IST 2007
Request org.apache.coyote.tomcat5.CoyoteRequestFacade@1ca7841 destroyed at Wed Aug 22 00:43:14 IST 2007


Regards,
Khushhal
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe using an expression scriptlet in a taglib attribute is an all or nothing deal. Either the entire thing must be the scriptlet or don't use a scriptlet at all.
 
khushhal yadav
Ranch Hand
Posts: 242
Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marc

In other way it means, it's not working because there is no reason for it to work. Is it so..

Regards,
Khushhal
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must make the attribute all scriptlet or no scriptlet. Either of the below should work:

All scriptlet:
default='<%= request.getParameter("class")+" and "+request.getParameter("age")%>'

No scriptlet:
default='${param.class} and ${param.age}'
 
khushhal yadav
Ranch Hand
Posts: 242
Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marc

Now it's working fine.
Was able to make out default='${param.class} and ${param.age}'
but
couldn't think of this default='<%= request.getParameter("class")+" and "+request.getParameter("age")%>'

Thanks a lot..

Regards,
Khushhal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic