• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Solution were found:
Change navigation rule description to associate commandButton with fake page and redirects from fake page to correct address.
Thanks,
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ilya Kudelin
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Have you no shame? Have you no decency? Have you no tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic