Originally posted by Timy McTipperstan:
Here is what I updated it too, any thoughts?
public class SomeClass implements java.io.Serializable {
Originally posted by Timy McTipperstan:
Someid will be taken from the URL that is passed in from the previous page. somejsp.jsp?someid=5, I put 5 in the sql because I was trying to at least be able to get something out of the rs, ahh no luck with that.
I'm not even sure if this is a good way of doing it. Any thoughts?
Originally posted by Timy McTipperstan:
<jsp:useBean id="someclass" scope="page" class="com.fh.db.SomeClass" />
<jsp:getProperty name="someclass" property="var1" /></<br>
<jsp:getProperty name="someclass" property="var2" /><br><br>
and i tried
<%=category.getVar1()%><br>
<%=category.getVar2()%><br><br>
There are several ways to retrieve JavaBeans component properties. Two of the methods (the jsp:getProperty element and an expression) convert the value of the property into a String and insert the value into the current implicit out object:
<jsp:getProperty name="beanName" property="propName"/>
<%= beanName.getPropName() %>
For both methods, beanName must be the same as that specified for the id attribute in a useBean element, and there must be a getPropName method in the JavaBeans component.
If you need to retrieve the value of a property without converting it and inserting it into the out object, you must use a scriptlet:
<% Object o = beanName.getPropName(); %>
Note the differences between the expression and the scriptlet; the expression has an = after the opening % and does not terminate with a semicolon, as does the scriptlet.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |