I have just begun to concern myself with JSF and came across the following problem that I have an application via a URL and GET parameters call start () and thus would then want to continue working. Various examples of myfaces.apache.org etc. already searched but unfortunately found anything suitable I found an example in the form of a so-called front controller, but unfortunately I do not get to run.. This time the problem File:
Code:
public class Controller extends HttpServlet (Front
Application private Factory factory;
private Application application;
/*
* Initialization of the servlet.
*/
public void init () throws ServletException (
factory = (Application Factory) FactoryFinder.getFactory (
FactoryFinder.APPLICATION_FACTORY);
factory.getApplication application = ();
)
/*
* Implementation of the GET method
*/
protected void doGet (HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException (
Object obj = req.getParameter ("param1");
String param1 = (obj! = Null)? obj.toString (): "";
obj = req.getParameter ("param2");
String param2 = (obj! = Null)? obj.toString (): "";
RepositoryBean pBean RepositoryBean = new ();
pBean.setParam1 (param1);
pBean.setParam2 (param2);
Faces Context jsfContext = FacesContext.getCurrentInstance ();
ELContext elContext jsfContext.getELContext = () // !!!!!!!
Application application = jsfContext.getApplication ();
Value Expression vExpr application.getExpressionFactory = () //!!!!!
.CreateValueExpression (elContext, "# (RepositoryBean)",
RepositoryBean.class);
vExpr.setValue elContext (pBean);
RequestDispatcher rd =
getServletContext ().getRequestDispatcher ("/ start.jsp");
rd.forward (req, res);
)
)
Has anyone since perhaps time a tip or possible even a working example .... Please help me to sort out my problem.
Bookmarks