• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to catch a expression returned string in a variable

 
Mahesh mumbai
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a jsp expression which will get the values as string and send this to output.

but.. in my current JSP is not displayed to the user so I cannot see the output if i mentioned the line in my JSP



but this jsp is not displated to the user..
but i want to catch the value of this expression and print the output to the console like this.




let me know any ideas.

Regards
Mahesh
 
Ahsan Bagwan
Ranch Hand
Posts: 254
1
Java MySQL Database Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I don't think expressions can be contained within scriptlets (I'm not sure).
 
Balaji Manoharan Bm
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can write
<% System.out.println(homepage.getUserSessionHelper().getUserData().getRegion()); %>

Inside these <% %> tags you can write java code in a normal way. But it is not a standard practice to write.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thatwon't do what the OP is asking for.

But, as pointed out, why are you using obsolete scriptlets in the first place?
 
Vivek SharmaJi
Ranch Hand
Posts: 38
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can just use like this, no need to use double scriptlets.

<% val = homepage.getUserSessionHelper().getUserData().getRegion() ; %>
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!