Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using dynamic keys with bean:message tag  RSS feed

 
L Duperval
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
     
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!