Results 1 to 4 of 4

Thread: Problems with bundle

  1. #1
    Join Date
    Jan 2009
    Posts
    9

    Unhappy Problems with bundle

    Hi.

    I am using Spring Security 2.0.4, Facelets 1.1.11, MyFaces 1.2.2, tomahawk 1.1.6.

    I have the following problem:

    when I use f:loadBundle in the page login.xhtml it that in turn it uses an template facelets ( template.xhtml ) and I execute it it leaves me the following error:

    HTTP 503
    The requested service () it is not available at the moment.

    my files are:

    template.xhtml
    ---------------
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!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:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Framework Expert - FEX</title>

    <link rel="stylesheet" type="text/css" href="${request.contextPath}/templates/fex_001/css/template.css" />
    <link rel="stylesheet" type="text/css" href="${request.contextPath}/templates/fex_001/css/pwc_fex.css" />
    <link rel="stylesheet" type="text/css" href="${request.contextPath}/templates/fex_001/windows_js/themes/default.css" />

    <script type="text/javascript" src="${request.contextPath}/templates/fex_001/windows_js/javascripts/prototype.js"> </script>
    <script type="text/javascript" src="${request.contextPath}/templates/fex_001/windows_js/javascripts/effects.js"> </script>
    <script type="text/javascript" src="${request.contextPath}/templates/fex_001/windows_js/javascripts/window.js"> </script>
    <script type="text/javascript" src="${request.contextPath}/templates/fex_001/windows_js/javascripts/window_effects.js"> </script>
    <script type="text/javascript" src="${request.contextPath}/templates/fex_001/windows_js/javascripts/debug.js"> </script>
    <script type="text/javascript" src="${request.contextPath}/templates/fex_001/javascripts/pwc_fex.js"> </script>
    </head>

    <body>

    <!-- Inicio Seccion Area de Trabajo Principal-->
    <div id="wrapper">

    <!-- Inicio Seccion Encabezado -->
    <div id="head-inside">
    <div id="head">
    <div align="left"><ui:insert name="greeting"></ui:insert></div>
    <img src="${request.contextPath}/templates/fex_001/images/txt_FEX.png" align="right" />
    </div>
    </div>
    <!-- Fin Seccion Encabezado -->

    <!-- Inicio Seccion Menu Principal -->
    <div id="mainmenu-inside">
    <div id="mainmenu-bg">
    <div id="mainmenu-txt">Sitio | Modulos</div>
    </div>
    </div>
    <!-- Fin Seccion Menu Principal -->

    <!-- Inicio Seccion Contenido -->
    <div id="content-inside">
    <div id="content">
    <ui:insert name="body"></ui:insert>
    <div id="menubar"></div>
    </div>
    </div>
    <!-- Fin Seccion Contenido -->

    <!-- Inicio Seccion Pie de Pagina -->
    <div id="footer-inside">
    <div id="footerbg">
    <div id="footerlogo"></div>
    <a href="j_spring_security_logout"><div id="footerdisconnect"></div></a>

    <div id="footer">
    Todos los Derechos Reservados &copy; 2008 - infoTECH Soluciones Ltda.<br />
    Desarrollado y Comercializado por: infoTECH Soluciones Ltda.
    </div>
    </div>
    </div>
    <!-- Fin Seccion Pie de Pagina -->

    </div>
    <!-- Fin Seccion Area de Trabajo Principal-->
    </body>

    </html>

  2. #2
    Join Date
    Jan 2009
    Posts
    9

    Default

    continue:

    login.xhtml
    -----------
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!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:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:t="http://myfaces.apache.org/tomahawk"
    xmlns:c="http://java.sun.com/jstl/core">
    <head>
    <title>Framework Expert</title>
    </head>
    <body>
    <ui:composition template="/templates/fex_001/template.xhtml">
    <f:loadBundle basename="com.infotechsoluciones.fex.bundle.messag es" var="msgs"/>
    <ui:define name="greeting"> <h:outputText value="#{msgs.msg_greeting}" /> al Framework Expert</ui:define>

    <ui:define name="body">
    <c:if test="${not empty param.login_error}">
    <font color="red">
    Su autenticación no fue exitosa.<br/>
    Razón: ${SPRING_SECURITY_LAST_EXCEPTION.message}.<br/><br/>
    </font>
    </c:if>
    <form action="/fex/j_spring_security_check" method="POST">
    <table align="center">
    <tr>
    <td>
    </td>
    </tr>
    <tr>
    <td align="right">Usuario</td>
    <td><input type='text' name='j_username' /></td>
    </tr>
    <tr>
    <td align="right">Clave</td>
    <td><input type='password' name='j_password' /></td>
    </tr>
    <tr>
    <td colspan='2' align="right">
    <input name="reset" type="reset" value="Limpiar" class="botton" />
    <input name="submit" type="submit" value="Ingresar" class="botton" />
    </td>
    </tr>
    </table>
    </form>

    </ui:define>
    </ui:composition>
    </body>
    </html>
    Last edited by widipa; Jan 8th, 2009 at 10:35 AM.

  3. #3
    Join Date
    Jan 2009
    Posts
    9

    Default

    continue:

    faces-config.xml
    -----------------
    <?xml version="1.0"?>

    <!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_1.dtd" >

    <faces-config version="1.2"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">

    <application>
    <locale-config>
    <default-locale>es</default-locale>
    <supported-locale>en_US</supported-locale>
    </locale-config>
    <message-bundle>com.infotechsoluciones.fex.bundle.messages</message-bundle>

    <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
    </application>

    <!-- managed beans of the simple hello world app -->
    <managed-bean>
    <managed-bean-name>helloWorldBacking</managed-bean-name>
    <managed-bean-class>
    com.infotechsoluciones.fex.HelloWorldBacking
    </managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>

    <!-- navigation rules for helloWorld.jsp -->
    <navigation-rule>
    <from-view-id>/index_ppal.xhtml</from-view-id>
    <navigation-case>
    <from-outcome>success</from-outcome>
    <to-view-id>/page2.xhtml</to-view-id>
    </navigation-case>
    </navigation-rule>

    <!-- navigation rules for page2.jsp -->
    <navigation-rule>
    <from-view-id>/page2.xhtml</from-view-id>
    <navigation-case>
    <from-outcome>back</from-outcome>
    <to-view-id>/index_ppal.xhtml</to-view-id>
    </navigation-case>
    </navigation-rule>
    </faces-config>
    Last edited by widipa; Jan 8th, 2009 at 10:36 AM.

  4. #4
    Join Date
    Jan 2009
    Posts
    9

    Default

    continue:

    applicationContext-security.xml
    -------------------------------
    <?xml version="1.0" encoding="UTF-8"?>

    <beans : beans xmlns="http://www.springframework.org/schema/security"
    xmlns : beans="http://www.springframework.org/schema/beans"
    xmlns : xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns : p="http://www.springframework.org/schema/p"
    xsi : schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-2.0.xsd
    http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.1.xsd">

    <http auto-config='true'>
    <intercept-url pattern="/login.jsf" filters="none"/>
    <intercept-url pattern="/templates/**" filters="none"/>
    <intercept-url pattern="/**" access="ROLE_ADMIN" />
    <form-login login-page='/login.jsf'
    authentication-failure-url="/login.jsf?login_error=1" />
    </http>

    <authentication-provider user-service-ref="userService" />

    <beans : bean id="userService" class="org.springframework.security.userdetails.jd bc.JdbcDaoImpl">
    <beans : property name="dataSource" ref="seguridadDataSource" />
    <beans : property name="enableGroups" value="true" />
    <beans : property name="enableAuthorities" value="false" />
    </beans : bean>

    <beans : bean id="seguridadDataSource"
    class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close"
    p : driverClassName="com.mysql.jdbc.Driver"
    p : url="jdbc:mysql://localhost:3306/seguridad?autoReconnect=true"
    p : username="root"
    p : password=""/>
    </beans : beans>

    messages.properties
    ---------------------
    msg_greeting=Bienvenido,

    messages_en_US.properties
    ---------------------------
    msg.greeting=Welcome,



    thank you ahead of time for their comments.
    Last edited by widipa; Jan 8th, 2009 at 10:36 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •