aspose file tools*
The moose likes JSF and the fly likes Form Being Rendered Outside of the Page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Form Being Rendered Outside of the Page" Watch "Form Being Rendered Outside of the Page" New topic
Author

Form Being Rendered Outside of the Page

Jason Thiesse
Greenhorn

Joined: Jun 12, 2007
Posts: 2
I am trying to do the following have one standard header.jsp file, but when I try to create a h:form in the header file the actual HTML form tag is rendered outside of the entire HTML tags.

home.jsp file



My header.jsp file


For whatever reason my form is rendered before anything else. Any ideas as to why?
Gabriel Claramunt
Ranch Hand

Joined: May 26, 2007
Posts: 375
Originally posted by Jason Thiesse:
I am trying to do the following have one standard header.jsp file, but when I try to create a h:form in the header file the actual HTML form tag is rendered outside of the entire HTML tags.

...

For whatever reason my form is rendered before anything else. Any ideas as to why?

Yes, if I remember correctly, JSF tags are processed before the normal html code.
Try surrounding your html code with "<f:verbatim>" tags.


Gabriel
Software Surgeon
a
Greenhorn

Joined: Jun 11, 2007
Posts: 7
Hi,
I have one comprehension question to the first code snippet. Doesnt the subview have to be nested inside the view tag and it is not better to just include a file and set the subview tag inside the included file?

Cu
Alex
Gabriel Claramunt
Ranch Hand

Joined: May 26, 2007
Posts: 375
I can see one advantage of not having the subview tags in the included file: you can include it in non-jsf context...
Jason Thiesse
Greenhorn

Joined: Jun 12, 2007
Posts: 2
Gagriel - I do not seem to have any problem with JSF tags rendering outside of the HTML other than the spot noted above.

Alexander - You are correct. I noticed my other forms at the site were not binding to the action methods until I moved my f:view to enclose the subviews.


Does anyone know if having the f:view outside of the html tag may be causing this behavior?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Form Being Rendered Outside of the Page