I have a jsp file and a bean file. I learnt how primitive data types are converted using 'valueOf'
method and the bean property is set , however i am still confused how class type values are set. The code below will make the query more clear.
Bean.java :
private Object myObject ;
public Object getMyObject() {
return myObject;
}
public void setMyObject(Object myObject)
{
System.out.println("my object - " + myObject);
File file = (File)myObject;
System.out.println("path - " + file.getPath());
this.myObject = myObject;
}
Index.jsp :
<jsp:useBean id="aBean" class="com.Bean" />
<%
File file = new File("some path");
%>
<jsp:setProperty name="aBean" property="myObject" value="<%= file %>" />
I am quite confused with how the thing value="<%= file %>"
works.
Thanks.