Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to make JSP Tag File use attribute without EL?  RSS feed

 
Steve Line
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi -

I'm trying to build a (previously believed to be) simple custom tag around the struts html:link tag. Basically the purpose of this tag I'm building will be to pop up a confirmation javascript message box when the link is clicked. If the user clicks 'cancel' in the message box then we don't go to the link.

My problem is in inserting the href value passed to the custom tag into
the html:link tag. Here's my jsp page code snippet:

Since I couldn't get my code to appear here on java ranch I put it on
my personal website. To see the post I wanted to put here please view
http://www.steveline.com/java. Thanks and sorry for the extra trouble.



We can't use EL on our destination app server, so we're not using it in
developemnt. This may be the problem. Do you know if that is really the problem or is it something else? If we can't use EL is there a workaround?

Thanks.

Steve
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66205
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We can't use EL on our destination app server


Why not? If your app server isn't running JSP 2.0, you can't use tag files either. If it is, why the proscription on the EL?
 
Steve Line
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK - it never fails - I can research something for days and as soon as I give up and post a question, I figure it out on my own.

I fixed it by turning isELIgnored="false" and changing my html:link line to
look like this:

html:link href="${href}" . . .

Thanks Bear.

To answer your question we're developing on tomcat but deploying on WebSphere 5. For some reason the customer's running an old WebSphere and we can't use EL there.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66205
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For some reason the customer's running an old WebSphere and we can't use EL there.


Then you're going to run into trouble with tag files too which require a JSP 2.0 engine.

At miminum I'd recommend developing on the same level of JSP that you will be deploying to. It'd be best if you were using the same container, but at least you should step back to an older version of Tomcat that's at the same specification level.
[ July 12, 2005: Message edited by: Bear Bibeault ]
 
Stefan Evans
Bartender
Posts: 1836
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Websphere 5 is a Servlet2.3/JSP1.2 container.
So you are correct EL won't work directly on it.
But then neither will tag files.

However that doesn't stop you using the EL as part of JSTL1.0
And there are also struts-el tag libraries which let you use the EL with struts if you so wish.

Besides that, would it not be easier just to use the straight struts:link tag and put an onclick event on it?
Or extend the struts tag class, and have your own code just set the onclick attribute manually.

And what Bear says about using the same deployment environment is excellent advice. You DON'T want to waste hours figuring it out in Tomcat 5 just to see it fall down around your ears when you try to deploy.

Good luck,
evnafets
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!