• Post Reply Bookmark Topic Watch Topic
  • New Topic

odd problem with bean prefixes in Tomcat4  RSS feed

 
William Stafford
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm porting a Tomcat3 application to Tomcat4. When JSPs are translated all generated variable names based on bean tag prefixes that contain the '-' character are incorrectly translated. The problem is that generated variable names based on these bean prefixes contain the "-" character. For example for an html-el tag using the prefix "html-el",
generatedStuff_html-el_moreGeneratedStuff.

Variable names with "-" in them are not legal Java so the translated JSPs fail to compile. This does not happen for the Tomcat3 version.

I easily got around this problem by replacing "-" with "_" for all occurrences of the affected tags but I'm wondering what is going on with the original translation errors.

Any ideas?

--beeky
 
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
Originally posted by William Stafford:
I'm porting a Tomcat3 application to Tomcat4.


Why not Tomcat 5? Or do you want to go through all this again in a few months?

Seriously, there is no reason to stick with JSP 1.2 at this point. If you're going to do a migration, do it to JSP 2.0 now.


When JSPs are translated all generated variable names based on bean tag prefixes that contain the '-' character are incorrectly translated.


It sucks, but the truth of the matter is you need to adjust them now and be sure all your new stuff follows accepted standards and naming rules.

Also, I'm not sure what you mean by "bean tag prefix".

but I'm wondering what is going on with the original translation errors.


I'm not getting what your question is at this point.
 
William Stafford
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear,
Thanks for taking a crack at my question. At to why tomcat4 not tomcat5, tomcat4 is our current standard.

I'll rephrase my question. Tags that normally use a prefix such 'bean-el' will not be translated correctly. Changing the prefix to 'bean_el' eliminated the problem but I'm wondering why the problem in the first place. Does tomcat4 require some sort of configuration that tomcat3 did not in order to deal with prefixes that contain the '-' character?

--biily
 
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
Originally posted by William Stafford:
At to why tomcat4 not tomcat5, tomcat4 is our current standard.


That doesn't really answer my question. And of course it's up to your organization to make whatever decisions it must, but I can think of no valid reason not to migrate directly to Tomcat 5. It's sort of like saying "We've been using chariots, but now we're going to upgrade to covered wagons".

I'd truly be interested to know the reasoning of the person behind this choice.

Originally posted by William Stafford:
but I'm wondering why the problem in the first place.


Unknown. And not having had a Tomcat 3 installation for years I have no opportunity and little incentive to investigate. It probably just comes down to an older version letting you get away with something invalid that a newer version does not.

Not surprisingly, Tomcat 4 uses a very different mechanism to generate code than Tomcat 3 -- and I'm sure that there are lots of differences from Tomcat 4 to Tomcat 5 (just one reason that migrating to an already obsolete version of Tomcat makes no sense to me). Bottom line is that identifiers (to include namespaces) should follow Java conventions. That means no dashes in the name.
[ January 05, 2006: Message edited by: Bear Bibeault ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!