This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using dynamic keys with bean:message tag  RSS feed

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to do use dynamic key to display messages using <bean:message>. For example, I'd like to do something like this in my JSP:



Now, the above doesn't work because the JSP compler doesn't know how to find the key "title.<%=action%>". I think I understand why this doesn't work. However, I don't see how I can make it work.

Here is my intent: I want a page to add/view/edit an object. THe pages will be close to identical. The only differences will be:

  • The title will change (to say View or Edit or Add)
  • The buttons will change (in the case of Edit or View, there will be a "Delete" button


  • I would like to limit the proliferation of pages, so one single JSP page should handle everything. The display will be controlled by the value of the "action" attribute of the request.

    Can anyone help me out?

    T'anks,

    L
     
    L Duperval
    Ranch Hand
    Posts: 63
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    AArgh! I posted to the wrong forum. Can someone move it to "Frameworks" or to the "JSTL" forum, whichever is more appropriate?

    Thanks,

    L
     
    What a stench! Central nervous system shutting down. Save yourself tiny ad!
    Rocket Oven Kickstarter - from the trailboss
    https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!