You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Christofer Jennings <bo...@gmail.com> on 2007/12/13 19:21:49 UTC
bad JSF rendering when using mvn jetty:run
I'm not sure where to post this question. It might be a JSF thing but the
problem I have only happens when I run mvn jetty:run.
For some reason when I use mvn jetty:run my JSF pages render wierd. 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: bad JSF rendering when using 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. I never figured out what else could have been causing my system to
act differently than others'. Oh well.
All's well that ends well.
,chris
On Dec 13, 2007 10:21 AM, Christofer Jennings <bo...@gmail.com> wrote:
> I'm not sure where to post this question. It might be a JSF thing but the
> problem I have only happens when I run mvn jetty:run.
>
> For some reason when I use mvn jetty:run my JSF pages render wierd. 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>
>
> ---------------------------------
>
>