You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Christofer Jennings <bo...@gmail.com> on 2007/12/13 19:27:54 UTC
JSF renders weird with mvn jetty:run
I'm not sure where to post this question. It might be a maven jetty plugin
thing but the problem I have only happens when I run mvn jetty:run on a JSF
project.
For some reason when I use mvn jetty:run my JSF pages render weird. The JSF
components render outside the <html> tag. If I build a war and deploy it to
jetty or tomcat the page renders as expected. ... Any ideas would be much
appreciated.
Here's the JSP. The bad output is below.
----- JSP -----------------------------------
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
<html>
<head>
<title>User Registration</title>
<link rel="stylesheet" href="styles/keys.css" type="text/css"
media="screen"/>
</head>
<body>
<f:view>
<h2><h:outputText value="User Registration"/></h2>
<h:outputText value="Modify/Update the information for users in the text
field boxes
and click the OK button."/>
<br/>
<h:form id="userRegistrationForm">
<h:messages/>
<h:panelGrid columns="4">
<h:outputText value="*First Name:"/>
<h:inputText value="#{userRegistrationController.user.firstName
}"
id="firstNameEntry" required="true"/>
<h:outputText value="*Last Name:"/>
<h:inputText value="#{userRegistrationController.user.lastName}"
id="lastNameEntry" required="true"/>
</h:panelGrid>
<h:commandButton action="success"
actionListener="#{
userRegistrationController.registerUser}" value="OK"/>
<h:commandButton value="Reset" type="reset"/>
</h:form>
</f:view>
</body>
</html>
-----------------------------------------
---- resulting html ------------------------
<h2>User Registration</h2>
Modify/Update the information for users in the text field boxes
and click the OK button.
<br/>
<form id="userRegistrationForm" name="userRegistrationForm" method="post"
action="/keys/test.jsf" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="userRegistrationForm"
value="userRegistrationForm" />
<table>
<tbody>
<tr>
<td>*First Name:</td>
<td><input id="userRegistrationForm:firstNameEntry" type="text"
name="userRegistrationForm:firstNameEntry" /></td>
<td>*Last Name:</td>
<td><input id="userRegistrationForm:lastNameEntry" type="text"
name="userRegistrationForm:lastNameEntry" /></td>
</tr>
</tbody>
</table>
<input type="submit" name="userRegistrationForm:j_id_id35" value="OK"
/><input type="reset" name="userRegistrationForm:j_id_id37" value="Reset"
/><input type="hidden" name="javax.faces.ViewState" id="
javax.faces.ViewState"
value="mUUiAHpX4mUz1jbTQWsYDgwwdlJk7EbLXyoxRcBOJTyVRjIL0WRyGneQ+kw29gFT43aXwg3YtZj3aAZs/tOIhW+zzgXIS9kt7dDDaTf+/sY="
/>
</form>
<html>
<head>
<title>User Registration</title>
<link rel="stylesheet" href="styles/keys.css" type="text/css"
media="screen"/>
</head>
<body>
<!-- MYFACES JAVASCRIPT -->
</body>
</html>
---------------------------------
Re: JSF renders weird with mvn jetty:run
Posted by Christofer Jennings <bo...@gmail.com>.
-- FIXED --
Turned out that a dependency in my Maven POM caused the trouble. I had
this...
<dependency>
<groupId>jsf-impl</groupId>
<artifactId>jsf-impl</artifactId>
<version>1.2.04</version>
<scope>compile</scope>
</dependency>
and for some reason taking it out fixed my problem.
A bizarre side note is that I was the only one on my team that saw the bad
behavior.
All's well that ends well.
,chris
On Dec 13, 2007 10:27 AM, Christofer Jennings <bo...@gmail.com> wrote:
> I'm not sure where to post this question. It might be a maven jetty plugin
> thing but the problem I have only happens when I run mvn jetty:run on a JSF
> project.
>
> For some reason when I use mvn jetty:run my JSF pages render weird. The
> JSF components render outside the <html> tag. If I build a war and deploy it
> to jetty or tomcat the page renders as expected. ... Any ideas would be much
> appreciated.
>
> Here's the JSP. The bad output is below.
> ----- JSP -----------------------------------
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
> <%@ taglib uri="http://myfaces.apache.org/tomahawk " prefix="t" %>
>
> <html>
> <head>
> <title>User Registration</title>
> <link rel="stylesheet" href="styles/keys.css" type="text/css"
> media="screen"/>
> </head>
> <body>
> <f:view>
> <h2><h:outputText value="User Registration"/></h2>
> <h:outputText value="Modify/Update the information for users in the
> text field boxes
> and click the OK button."/>
> <br/>
> <h:form id="userRegistrationForm">
>
> <h:messages/>
>
> <h:panelGrid columns="4">
> <h:outputText value="*First Name:"/>
> <h:inputText value="#{
> userRegistrationController.user.firstName}"
> id="firstNameEntry" required="true"/>
> <h:outputText value="*Last Name:"/>
> <h:inputText value="#{userRegistrationController.user.lastName
> }"
> id="lastNameEntry" required="true"/>
> </h:panelGrid>
>
> <h:commandButton action="success"
> actionListener="#{
> userRegistrationController.registerUser}" value="OK"/>
> <h:commandButton value="Reset" type="reset"/>
>
> </h:form>
> </f:view>
> </body>
> </html>
> -----------------------------------------
>
> ---- resulting html ------------------------
> <h2>User Registration</h2>
> Modify/Update the information for users in the text field boxes
> and click the OK button.
> <br/>
>
> <form id="userRegistrationForm" name="userRegistrationForm" method="post"
> action="/keys/test.jsf" enctype="application/x-www-form-urlencoded">
> <input type="hidden" name="userRegistrationForm"
> value="userRegistrationForm" />
> <table>
> <tbody>
> <tr>
> <td>*First Name:</td>
> <td><input id="userRegistrationForm:firstNameEntry" type="text"
> name="userRegistrationForm:firstNameEntry" /></td>
> <td>*Last Name:</td>
>
> <td><input id="userRegistrationForm:lastNameEntry" type="text"
> name="userRegistrationForm:lastNameEntry" /></td>
> </tr>
> </tbody>
> </table>
> <input type="submit" name="userRegistrationForm:j_id_id35" value="OK"
> /><input type="reset" name="userRegistrationForm:j_id_id37" value="Reset"
> /><input type="hidden" name=" javax.faces.ViewState" id="
> javax.faces.ViewState"
> value="mUUiAHpX4mUz1jbTQWsYDgwwdlJk7EbLXyoxRcBOJTyVRjIL0WRyGneQ+kw29gFT43aXwg3YtZj3aAZs/tOIhW+zzgXIS9kt7dDDaTf+/sY="
> />
> </form>
>
>
>
> <html>
> <head>
> <title>User Registration</title>
> <link rel="stylesheet" href="styles/keys.css" type="text/css"
> media="screen"/>
> </head>
>
> <body>
>
> <!-- MYFACES JAVASCRIPT -->
>
> </body>
> </html>
> ---------------------------------
>
>
>
Re: JSF renders weird with mvn jetty:run
Posted by Rene Guenther <in...@innflow.com>.
As far as I know if you use JSP with JSF you should not mix HTML with
JSF. If you want to use HTML directly you should use the f:verbatim
tag, eg
<f:verbatim>
<h2>
</f:verbatim>
<h:outputText value="User Registration"/>
<f:verbatim>
</h2>
</f:verbatim>
or in that case:
<h:outputText value="<h2>User Registration</h2>"/>
Maybe your problem is related to this...
If you still can: skip JSP and use Facelets ;-)
René
On Thu, 13 Dec 2007 10:27:54 -0800
"Christofer Jennings" <bo...@gmail.com> wrote:
> I'm not sure where to post this question. It might be a maven jetty
>plugin
> thing but the problem I have only happens when I run mvn jetty:run
>on a JSF
> project.
>
>For some reason when I use mvn jetty:run my JSF pages render weird.
>The JSF
> components render outside the <html> tag. If I build a war and
>deploy it to
> jetty or tomcat the page renders as expected. ... Any ideas would be
>much
> appreciated.
>
> Here's the JSP. The bad output is below.
> ----- JSP -----------------------------------
> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
> <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
>
> <html>
> <head>
> <title>User Registration</title>
> <link rel="stylesheet" href="styles/keys.css" type="text/css"
> media="screen"/>
> </head>
> <body>
> <f:view>
> <h2><h:outputText value="User Registration"/></h2>
> <h:outputText value="Modify/Update the information for users in
>the text
> field boxes
> and click the OK button."/>
> <br/>
> <h:form id="userRegistrationForm">
>
> <h:messages/>
>
> <h:panelGrid columns="4">
> <h:outputText value="*First Name:"/>
> <h:inputText
>value="#{userRegistrationController.user.firstName
> }"
> id="firstNameEntry" required="true"/>
> <h:outputText value="*Last Name:"/>
> <h:inputText
>value="#{userRegistrationController.user.lastName}"
> id="lastNameEntry" required="true"/>
> </h:panelGrid>
>
> <h:commandButton action="success"
> actionListener="#{
> userRegistrationController.registerUser}" value="OK"/>
> <h:commandButton value="Reset" type="reset"/>
>
> </h:form>
> </f:view>
> </body>
> </html>
> -----------------------------------------
>
> ---- resulting html ------------------------
> <h2>User Registration</h2>
> Modify/Update the information for users in the text field boxes
> and click the OK button.
> <br/>
>
> <form id="userRegistrationForm" name="userRegistrationForm"
>method="post"
> action="/keys/test.jsf" enctype="application/x-www-form-urlencoded">
> <input type="hidden" name="userRegistrationForm"
> value="userRegistrationForm" />
> <table>
> <tbody>
> <tr>
> <td>*First Name:</td>
> <td><input id="userRegistrationForm:firstNameEntry" type="text"
> name="userRegistrationForm:firstNameEntry" /></td>
> <td>*Last Name:</td>
>
> <td><input id="userRegistrationForm:lastNameEntry" type="text"
> name="userRegistrationForm:lastNameEntry" /></td>
> </tr>
> </tbody>
> </table>
> <input type="submit" name="userRegistrationForm:j_id_id35"
>value="OK"
> /><input type="reset" name="userRegistrationForm:j_id_id37"
>value="Reset"
> /><input type="hidden" name="javax.faces.ViewState" id="
> javax.faces.ViewState"
> value="mUUiAHpX4mUz1jbTQWsYDgwwdlJk7EbLXyoxRcBOJTyVRjIL0WRyGneQ+kw29gFT43aXwg3YtZj3aAZs/tOIhW+zzgXIS9kt7dDDaTf+/sY="
> />
> </form>
>
>
>
> <html>
> <head>
> <title>User Registration</title>
> <link rel="stylesheet" href="styles/keys.css" type="text/css"
> media="screen"/>
> </head>
>
> <body>
>
> <!-- MYFACES JAVASCRIPT -->
>
> </body>
> </html>
> ---------------------------------