File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Incorrect action value in html's form created from h:form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Incorrect action value in html Watch "Incorrect action value in html New topic
Author

Incorrect action value in html's form created from h:form

Ilya Kudelin
Greenhorn

Joined: Aug 24, 2011
Posts: 7
Hi,
I'm developing simple web project using jsf.
Under this activity I created a search form. The shema of jsf pages is next:
index.xhtmls contains <ui:include> and <h:form> tags. main.xhtml is included by default. <h:form> tag contains <h:commandButton> with parameter <f:param> which switch inclusion on index.xhtml to search.xhtml.
'action' atribute of <h:commandButton> sets to "#searchBean.search" which returns String "toSearch".
There is navigation rule added to faces-config:

I'm using tomcat server to run aplications. Ip address is assigned for this server, so it can be reached via Internet. Also customer has proxy, it is configured to resolve DNS name into IP of my server. IP URI to reach the application is http://<ip>/<application_name>/light/index.jsf DNS URI to reach the server is http://<application_name>.<customer_site>/light/index.jsf

When I'm using ip URI, search will work fine, but when I am using DNS URI, search's form 'action' attribute will be set into 'http://<application_name>.<customer_site>/<application_name>/light/index.jsf' in created HTML. (MUST be 'http://<application_name>.<customer_site>/light/index.jsf').

Please, help, what am I do wrong? Why does search form redirect to wrong location?
Ilya Kudelin
Greenhorn

Joined: Aug 24, 2011
Posts: 7
Solution were found:
Change navigation rule description to associate commandButton with fake page and redirects from fake page to correct address.
Thanks,
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15665
    
  15

I think that you'll find that you can dispense with the indirection:



As I've said, there's a difference between resource paths and URL paths. They only look similar.


Customer surveys are for companies who didn't pay proper attention to begin with.
Ilya Kudelin
Greenhorn

Joined: Aug 24, 2011
Posts: 7
Tim Holloway wrote:I think that you'll find that you can dispense with the indirection:


When I'm waiting the page will process form's request themself, yes.
Thanks for the comment.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Incorrect action value in html's form created from h:form
 
Similar Threads
JSF: Hitting Enter on an inputText component
faces-config not working
JSF <h:commandButton action> not working
from-view-id with params
redirection from backbean