User: starksm Date: 01/12/10 17:31:01 Modified: src/resources/web/restricted Tag: Branch_2_4 include_ejb.jsp Log: Add call to secured ejb from the include_ejb.jsp to test that the completion of the included ejb.jsp page does not clear the security association for the include_ejb.jsp page. Revision Changes Path No revision No revision 1.1.2.2 +34 -1 jbosstest/src/resources/web/restricted/include_ejb.jsp Index: include_ejb.jsp =================================================================== RCS file: /cvsroot/jboss/jbosstest/src/resources/web/restricted/include_ejb.jsp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- include_ejb.jsp 2001/09/03 22:56:11 1.1.2.1 +++ include_ejb.jsp 2001/12/11 01:31:01 1.1.2.2 @@ -1,5 +1,28 @@ -<%@page contentType="text/html"%> +<%@page contentType="text/html" + import="javax.naming.*,org.jboss.test.web.interfaces.*" +%> +<%! + private String callEJB(String arg) throws ServletException + { + String value = null; + try + { + InitialContext ctx = new InitialContext(); + Object ref = ctx.lookup("java:comp/env/ejb/SecuredEJB"); + StatelessSessionHome home = (StatelessSessionHome) ref; + StatelessSession bean = home.create(); + String echoValue = bean.echo(arg); + value = "SecuredEJB.echo("+arg+") returned: "+echoValue; + } + catch(Exception e) + { + throw new ServletException(e); + } + return value; + } +%> + <html> <head><title>JSP Include ejb.jsp Test</title></head> <body> @@ -7,6 +30,16 @@ <jsp:include page="ejb.jsp" flush="true"> <jsp:param name="name" value="d1"/> </jsp:include> +<!-- Make an access attempt from this page to check that the completion of +the include does not clear the security credentials. +--> +<h1>Top level JSP to EJB Test</h1> +<% + String reply = callEJB("From include_ejb.jsp"); + out.println(reply); + out.flush(); +%> + <jsp:include page="ejb.jsp" flush="true"> <jsp:param name="name" value="d2"/> </jsp:include>
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development