Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing values

 
Edwin Abraham
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i have a "test.jhtml" file in that i have serverside includes like
<servlet code=abc ></servlet> now iam passing(typing in the addressbar) suppose say
"test.jhtml?id=101 " ....how does my "test.jshtm " get that value of " id " so that i can use that value in my "abc " class file included in "servlet tag"
Regards
Edwin.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
since what ever you passed thru URL it stores in request since you are passing thru URL and default parameter passing is GET method so, servlet class takes all the parameters given in the URL and it will access those parameters thru request object.
Regards,
venkat

Originally posted by Edwin:
Hi,
i have a "test.jhtml" file in that i have serverside includes like
<servlet code=abc ></servlet> now iam passing(typing in the addressbar) suppose say
"test.jhtml?id=101 " ....how does my "test.jshtm " get that value of " id " so that i can use that value in my "abc " class file included in "servlet tag"
Regards
Edwin.

 
henley
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, you cannot do this. Since you are using JHTML, the only way to get the value of the request parameter is through JavaScript, and since JavaScript code won't be executed until the page gets to the client, it will be too late for the <SERVLET> tag process it. All <SERVLET> tags must be static, unless the server you are using provides a mechanism for making them dynamic.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic