0

So basically I'm trying to work out if I can set the value in the jsp:setProperty function, to a the string variable that was declared in a previous scriptlet.

My code is below. Thankyou so much in advance :)

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <%
            String type = request.getParameter("type");
        %>
        <title><% out.println(type);%> </title>
    </head>

    <jsp:useBean id="myBean" scope="session" class="org.geeks.Second"/>
    <jsp:setProperty name="myBean" property="type" value=""/>
Jack Gads
  • 1
  • 3

1 Answers1

0

So I managed to solve it. From trial and error I found I could just pump a scriptlet into the value as seen below.

<jsp:setProperty name="myBean" property="type" value="<%= type %>"/>
Jack Gads
  • 1
  • 3