Results 1 to 2 of 2
  1. #1
    kulangotski is offline Senior Member
    Join Date
    Feb 2009
    Posts
    117
    Rep Power
    0

    Default how do you write set a propert of a bean using a scriptlet?

    hi! thanks for reading,

    I am trying to set a property of a bean of mine from a request parameter and the compiler is telling me that it is incorrect

    my script is

    <jsp:useBean id="stringbean"
    scope="session"
    class="com.vbc.beans.myBean" />

    <jsp:setProperty name="stringbean"
    property="lastName"
    value="<%=request.getParameter("lastName")%>" />

    i don't know what else to do.
    any help would be appreciated! :D

    the parameter lastname, I already tested it. if would do

    <%=request.getParameter("lastName")%>

    outside of the jsp tag it will display the proper value of the parameter. i just don't know how to embed the value to a bean with the method I pasted above.

  2. #2
    kulangotski is offline Senior Member
    Join Date
    Feb 2009
    Posts
    117
    Rep Power
    0

    Default

    geeeez ...

    just needed to have the double quotes changed to single quotes. instead of value="..." used value='...'

Similar Threads

  1. Replies: 1
    Last Post: 02-01-2010, 08:25 AM
  2. Replies: 0
    Last Post: 04-06-2008, 08:43 PM
  3. Detecting browser with JSP scriptlet
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-24-2007, 11:05 AM
  4. About bean:write
    By yuchuang in forum Web Frameworks
    Replies: 1
    Last Post: 04-30-2007, 04:31 PM
  5. Struts tag error with bean:write
    By sandor in forum Web Frameworks
    Replies: 1
    Last Post: 04-07-2007, 05:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •