I am trying to initialize a class by passing a parameter to the constructor. I need the scope to be "page". I know I have one argument in my constructor, but how do I have one that accepts parameter using <jsp:useBean>
, and can be called from a JSP page?
public class A extends B {
A(ServletRequest req) {
super(req);
}
If there are no-arg constructor, We can use < jsp:useBean id="someId" class="mypackage.A" scope="page" />
tag. But in a useBean JSP tag, you can't invoke any constructor.
Is there any way initialize class with constructor?