[jboss-user] [JBoss Seam] - Re: JSF Form Authentication using JAAS DatabaseServerLoginMo

yj4jboss do-not-reply at jboss.com
Tue Nov 14 00:07:43 EST 2006


Ok the resource bundle and JAAS  is working perfectly ...... The only problem is that the page is rendered without any styles being displayed although the template used is correctly rendered with other pages !! When i looked at the source in my browser i found that the stylesheet imports have been commented as shown below:

This is the source as displayed by IE:

  | 
  | <?xml version="1.0" encoding="utf-8"?>
  | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
  | <html xmlns="http://www.w3.org/1999/xhtml">
  | <head>          
  |     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  |     <title></title>
  | 
  | <style type="text/css" media="all"><!--
  | 
  |     @import "style/default/screen.css";
  |     @import "style/default/financialstatementprogress.css";
  |     @import "style/default/overviewInfo.css";
  |     @import "style/default/questionnaireheader.css";
  |     @import "style/default/groupHierarchy.css";
  |     @import "style/default/groupAndQuestions.css";
  | 
  | --></style>
  | 
  | </head>
  | 
  | <body id="pgMainMenu">
  | 	
  |     <div id="document"> 
  |         <div id="header"><span>Banner Goes Here</span></div>
  | 
  | 
  |      <div id="container">
  | 
  | 		<div class="formContainer">
  | 
  | 		<form action="j_security_check" method="post">
  | 	      <label for="j_username">Username</label>
  | 	      <input type="text" name="j_username" />
  | 	      <br />
  | 	
  | 	      <label for="j_password">Password</label>
  | 	      <input type="password" name="j_password" />
  | 	
  | 	      <br />
  | 	      <input type="submit" value="Login" id="Submit" />
  | 	   </form>
  | 
  | 
  | 		</div>
  |     </div>
  |     
  |       <div id="footer">     
  | 	      <hr />
  | 			  	Footer Goes here ....
  | 
  | 	  </div>
  |     
  |   </div>
  |   
  | 
  |       
  | </body>
  | </html>
  | 
  | 


This is my login.xhtml:

  | 
  | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  |                       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  | <html xmlns="http://www.w3.org/1999/xhtml"
  | 	xmlns:s="http://jboss.com/products/seam/taglib"
  | 	xmlns:ui="http://java.sun.com/jsf/facelets"
  | 	xmlns:f="http://java.sun.com/jsf/core"
  | 	xmlns:h="http://java.sun.com/jsf/html"
  | 	xmlns:si="http://sourceforge.net/projects/easysi"
  | 	xmlns:t="http://myfaces.apache.org/tomahawk">
  | 
  | <head>
  |     <f:loadBundle basename="messages" var="msgs" />     
  |     <title></title>
  | 
  | 
  | 
  | </head>
  | 
  | <body>
  | 
  | <ui:composition template="/template.xhtml">
  | 
  | 		<ui:define name="topnav">
  | 		<!--Navigation bar is not displayed in login page -->
  | 		</ui:define>
  | 		
  | 		<ui:define name="container">
  | 
  | 		<div class="formContainer">
  | 
  | 		<form action="j_security_check" method="post">
  | 	      <label for="j_username">#{msgs.Username}</label>
  | 	      <input type="text" name="j_username" />
  | 	      <br />
  | 	
  | 	      <label for="j_password">#{msgs['Password']}</label>
  | 	      <input type="password" name="j_password" />
  | 	
  | 	      <br />
  | 	      <input type="submit" value="#{msgs['LoginButton']}" id="Submit" />
  | 	   </form>
  | 
  | 
  | 		</div>
  | 		
  | 		</ui:define>
  | 
  | 
  | </ui:composition>
  | </body>
  | </html>
  | 
  | 
  | 


An my template.xhtml is as follows:

  | <?xml version="1.0" encoding="utf-8"?>
  | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  |                       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  | <html xmlns="http://www.w3.org/1999/xhtml"
  |       xmlns:ui="http://java.sun.com/jsf/facelets"
  |       xmlns:h="http://java.sun.com/jsf/html"
  |       xmlns:f="http://java.sun.com/jsf/core">
  | <head>
  |     <f:loadBundle basename="messages" var="msgs" />     
  |     <f:loadBundle basename="settings" var="settings" />         
  |     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  |     <title></title>
  | 
  | <style type="text/css" media="all">
  |     @import "style/default/screen.css";
  | </style>
  | 
  | </head>
  | 
  | <body id="pgMainMenu">
  | 	
  | 	<f:loadBundle basename="messages" var="msg"/>
  | 	
  |     <div id="document"> 
  |     	<ui:insert name="banner">
  |         <div id="header"><span>#{msg.BannerText}</span></div>
  | 
  |         </ui:insert>
  |         
  | 
  |             <ui:insert name="topnav">
  |             <div id="nav"> 
  | 				<ui:include src="/menu.xhtml" />
  | 		     </div>
  |             </ui:insert>
  | 
  | 
  |      <div id="container">
  | 	      <ui:insert name="container">     
  |                     Content goes here ...
  |            </ui:insert>
  |     </div>
  |     
  |       <div id="footer">
  | 	      <ui:insert name="footer">     
  | 	      <hr/>
  | 			  	#{msg.FooterText}
  |            </ui:insert>
  | 
  | 	  </div>
  |     
  |   </div>
  |   
  | 
  |       
  | </body>
  | </html>
  | 
  | 
  | 



In my web.xml, i had the following configs to specify the login form i want to use:

  |     <login-config>
  | 		<auth-method>FORM</auth-method>
  | 			<form-login-config>
  | 				<form-login-page>/login.seam</form-login-page>
  | 				<form-error-page>/login_errors.html</form-error-page>
  | 			</form-login-config>
  | 	</login-config>
  | 
  | 



Is there any missing configs or is there something missing for the CSS to be correctly rendered ??


Regards,
Jankee Yogesh
http://www.m-itc.net

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985693#3985693

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3985693



More information about the jboss-user mailing list