• Post Reply Bookmark Topic Watch Topic
  • New Topic

Invoke action method with URL

 
Alex Hui
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to invoke a action method in a managed bean with a URL entered to the web browser directly, and not with actionLink or actionButton? With struct I have some way to do it.
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can write a servlet that calls the action method of the backing bean in the doGet() / doPost() methods.
 
Sergey Smirnov
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at How to Make Struts People Happy with JSF article.

P.S. In general, best way to use jsf effectively is to avoid using a Struts paradigm in web development.
 
Alex Hui
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get this in the exadel blog:
I think the reason why JSF doesn�t let an action handler determine the view to use on a GET request is that this is an unnatural thing to do given the semantics of GET! POST, PUT, DELETE can �decide� things, but GET should just display something; the same thing every time

I think displaying same thing with same URL does not contradict with invoking action with URL (HTTP get request). Since in GET requests, request parameters are also included in the URL and will be bookmarked. If we entered different parameter, different thing will be display. So URL still points to a specific result page.

Originally posted by Sergey Smirnov:
Take a look at How to Make Struts People Happy with JSF article.

P.S. In general, best way to use jsf effectively is to avoid using a Struts paradigm in web development.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!