I have got below details to share with all Just have a look it might help to clear doubts of <useBean> tag
answer is 1.
1. The only requirement for a class to be used as a bean in a JSP page is that the class should have a public no-args constructor, so the the JSP engine can instantiate the class. The following the the relevent postion of the code generated by tomcat for this page:
catch (ClassNotFoundException exc)
throw new InstantiationException(exc.getMessage());
catch (Exception exc)
throw new ServletException (" Cannot create bean of class "+"java.lang.Integer", exc);
The String class has a no args constructor, so an empty string object is created.
2. The jsp:setProperty action in this question tries to set all the properties of the bean from the values present in the request. However, the String class does not have any method named setMystring() and so the page prints "".