• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can the 'id' in jsp:useBean id="xxx". be set using a Constants file ?

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Please confirm me this ..
Suppose that I have a value in my constant file,Constants.java :

public String OUTPUT_KEY = "output" ;
.....
After some processing of the request,
the response handler creates a valid viewBean object,say, 'info' and sets it's attributre value as :
info.setAttribute(Constants.OUTPUT_KEY,someValidObject) ...
....

Now , in the success.jsp where I want to display the details of the viewBean,
I generally get the response bean by saying...

<jsp:useBean id="output" scope="someScope" type="validClassType" />
While setting the value of 'id' as above,we should remember the value of OUTPUT_KEY in constants file and set 'id' to this same value,means we are hardcodng it.

I do not want to hardcode id="output" here..
I want to use the Constants.OUTPUT_KEY value directly to set value of 'id'.
If not,whenever a change is made to OUTPUT_KEY in Constants.java,we need to change the value that 'id' is set to in the jsp.

Any answers on this please....?

Constants.OUTPUT_KEYid="output"
[ May 28, 2005: Message edited by: rk motorola ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What did the error message tell you when you tried it?
 
reply
    Bookmark Topic Watch Topic
  • New Topic