The string value is being requested using script tags but I'm not sure how to add the value of fibNum
to the input field's content.
Does anyone know how to achieve this?
For example in java, the string variable's value can be added to a println statement as follows:
system.out.println("The value is: " + fibNum);
This is how I'm requesting the value, its then stored in a string variable called fibNum
<% String fibNum = request.getParameter("fibNum"); %>
<input type="text" name="fibNum" size="40px" style="font-size:30pt;height:60px">
If your are using it in general (with no association of any BEAN) then scriplets wiht solve your query, as given by @Roberto
<% String fibNum = request.getParameter("fibNum"); %>
<input type="text" name="fibNum" value="<%=fibNum%>" size="40px" style="font-size:30pt;height:60px">
But if you are using it with some bean and want to associate it under some session, it's always better use EL and JSTL.
<input type="text" name="fibNum" value="#{managedBean.funcReturningParam}" size="40px" style="font-size:30pt;height:60px">
funcReturningParam
is the method which processes the values, both from frontend and backend, and then sets the parameters.
managedBean
used should preferably
be the one with least security and debugging issues.
PS: Try to make a common function in any managed bean, which is to be used to get(set) values of most used parameters(variables) to be used and which are not associated with the DB Entities.