Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
struts2 + jaas on jboss...

struts2 + jaas on jboss...

2007-11-07       - By Filippov, Andrey

 Back
Reply:     1     2     3  


Hi everybody!

I have this problem - I could not manage to configure it to work together. Does
someone happen to know how to do it? I appriciate any kind of information!!
Initially I used the following source: http://www.javaworld.com/javaforums
/showthreaded.php?Cat=2&Number=2500&page=0
And I have the following:

jboss-web.xml
<?xml version="1.0" encoding="UTF-8 (See http://UTF-8.ora-code.com)"?>
<jboss-web>
<security-domain>java:/jaas/dbStrutsRealm</security-domain>
</jboss-web>
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
-- ----
snippet from login-config.xml

<application-policy name = "dbStrutsRealm">
  <authentication>
  <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
        flag = "required">
        <module-option name = "dsJndiName">java:/FilStrutsDS</module-option>
        <module-option name = "principalsQuery">
              select password from test_login where login_name=?
        </module-option>
        <module-option name = "rolesQuery">
              SELECT role_name, 'Roles' FROM user_in_roles INNER JOIN roles ON
user_in_roles.role=roles.id where user_in_roles.user=?
        </module-option>
        <module-option name = "debug">true</module-option>
  </login-module>
  </authentication>
</application-policy>
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
-- ----
snippet from web.xml
  <security-constraint>
   <web-resource-collection>  
    <web-resource-name>
      action
    </web-resource-name>
    <description>
      Struts security test
    </description>
    <url-pattern>/Logout.action</url-pattern>
    <http-method>HEAD</http-method>
    <http-method>GET</http-method>
    <http-method>POST</http-method>
    <http-method>PUT</http-method>
    <http-method>DELETE</http-method>
   </web-resource-collection>
   <auth-constraint>
      <role-name>access</role-name>
   </auth-constraint>
   <user-data-constraint>
      <description>
      noo
    </description>
    <transport-guarantee>
      NONE
    </transport-guarantee>
   </user-data-constraint>  
  </security-constraint>


  <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>struts_test</realm-name>
    <form-login-config>
      <form-login-page>/Login.action</form-login-page>
      <form-error-page>/jsp/Login_error.jsp</form-error-page>
    </form-login-config>
  </login-config>
 
  <security-role>
    <description/>
    <role-name>access</role-name>
  </security-role>
  <security-role>
    <description/>
    <role-name>rejection</role-name>
  </security-role>
  <security-role>
    <description/>
    <role-name>misc</role-name>
  </security-role>
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
-- ----
snippet from struts.xml

<package name="login" namespace="/login" extends="struts-default" >
<result-types>
<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"/>
</result-types>
<action name="Login">
<result>/jsp/Login.jsp</result>
</action>
<action name="Login1" class="com.fil.struts.login.SessionLogin">
<result name="ERROR">/jsp/Login.jsp</result>
<result type="tiles" name="SUCCESS">success</result>
</action>
<action name="Logout" class="com.fil.struts.login.SessionLogout">
<result name="SUCCESS">/jsp/Login.jsp</result>
</action>
<!-- Add actions here -->
</package>
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
-- ----
snippet from login.jsp
<form name="logonForm" action="Login1.action" method="POST">
      <table>
       <tr>
      <td colspan="2">
        Login
      </td>

    </tr>

      <tr>
        <td colspan="2">
            <input type="text" name="j_username" SIZE=25/><br>
            <input type="password" name="j_password" SIZE=25/><br>
            <input type="submit" onclick="javascript:submitForm();" value="Login"/
>  
        </td>
      </tr>
      </table>    
   </form>
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
-- ----
Finally, when I submit the mentioned in the login.jsp form I get the following
message:

Struts Problem Report
Struts has detected an unhandled exception:
Messages:   No result defined for action com.fil.struts.login.SessionLogin and
result input  
File:   file:/C:/jboss-4 (See http://oss-4.ora-code.com).0.5.GA/server/default/./tmp/deploy
/tmp15883StrutsSessionLogIn-exp.war/WEB-INF/classes/struts.xml  
Line number:   25  
Column number:   65  

<action name="Login1" class="com.fil.struts.login.SessionLogin">
<result name="ERROR">/jsp/Login.jsp</result>
<result type="tiles" name="SUCCESS">success</result>

Stacktraces
No result defined for action com.fil.struts.login.SessionLogin and result input
- action - file:/C:/jboss-4 (See http://oss-4.ora-code.com).0.5.GA/server/default/./tmp/deploy
/tmp15883StrutsSessionLogIn-exp.war/WEB-INF/classes/struts.xml:25:65
   com.opensymphony.xwork2.DefaultActionInvocation.executeResult
(DefaultActionInvocation.java:350)
   com.opensymphony.xwork2.DefaultActionInvocation.invoke
(DefaultActionInvocation.java:253)
   com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept
(ValidationInterceptor.java:150)
   org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor
.doIntercept(AnnotationValidationInterceptor.java:48)
   com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept
(MethodFilterInterceptor.java:86)
   com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling
(DefaultActionInvocation.java:224)
   com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling
(DefaultActionInvocation.java:223)
   com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile
(UtilTimerStack.java:455)
   com.opensymphony.xwork2.DefaultActionInvocation.invoke
(DefaultActionInvocation.java:221)
   com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept
(ConversionErrorInterceptor.java:123)
   com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling
(DefaultActionInvocation.java:224)
   com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling
(DefaultActionInvocation.java:223)
   com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile
(UtilTimerStack.java:455)
   com.opensymphony.xwork2.DefaultActionInvocation.invoke
(DefaultActionInvocation.java:221)


What I am doing wrong? Please correct me!!
Thanx a lot.





Sincerely yours,
Andrey V. Filippov


Sincerely yours,
Andrey V. Filippov