myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MPF <markus.pfeif...@procon.co.at>
Subject Re: Myfaces - application calling by link which include parameter
Date Mon, 11 Jun 2007 12:38:02 GMT

So i try to change my application to a filter:

public class FrontDoorFilter implements Filter {
		
	public void destroy() {
		//nothiing to do
	}
	
	public void doFilter(ServletRequest req, ServletResponse res, FilterChain
fc)
		throws IOException, ServletException {
			String oclcNum = req.getParameter(\"oclcNum\");
			// did we get a parameter on the request?
			if (oclcNum != null) {
			  HttpServletRequest httpReq = (HttpServletRequest) req;
			  Curiouser backingBean = (Curiouser) httpReq.getSession().getAttribute(
			      \"Curiouser\");
			  // is the backing bean already in the session?
			  if (backingBean != null) {
			    // is the backing bean's parameter still unset?
			    if (backingBean.getOclcNum() == null) {
			      backingBean.setOclcNum(oclcNum);
			    }
			  } else { // create the backing bean and put it in the session
			backingBean = new Curiouser();
			backingBean.setOclcNum(oclcNum);
			httpReq.getSession().setAttribute(\"Curiouser\", backingBean);
			  }
			}
			fc.doFilter(req, res);
	}

	public void init(FilterConfig arg0) throws ServletException {
		//nothing to do
	}
}

at first the line:
String oclcNum = req.getParameter(\"oclcNum\");
has a syntax error (the first \)

furthermore how i use this filter (add to web.xml and how i call it?)
see:
http://marcchung.com/2005/01/24/performing-a-jsf-get-2/
-- 
View this message in context: http://www.nabble.com/Myfaces---application-calling-by-link-which-include-parameter-tf3889911.html#a11059806
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Mime
View raw message