• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP setProperty

 
I Ritchie
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How can I insert a JSP variable into a setProperty as follows. I cant do the follwing because the variable needs to be in quotes.
<jsp:setProperty name="user" property="userID" value=<%out.print(variableName)%> />
Also I cannot do the following, because otherwise my variable will be set to 'out.print(variableName)'.
<jsp:setProperty name="user" property="userID" value="<%out.print(variableName)%>" />
Any suggestions?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

hth,
bear
 
John Suarez
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, in those cases where you need quotes, etc., I believe you CAN use single quotes combined with double quotes, as in:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!