OK I did get it working here is the code I used. I would like to know if there is a better way I can do this. I am trying to get the user name which I will be using to pull personalized data from a database which is the reason I need the username. I am trying to do the site mainly in jsp but I am somewhat new to j2ee stuff and would welcome any feedback one could give me about a better way. <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> | <%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %> | <%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %> | <%@ page import="javax.servlet.http.HttpServlet" %> | <%@ page import="java.security.Principal" %> | <%@ page import="javax.servlet.http.HttpServletResponse" %> | <%@ page import="javax.servlet.http.HttpServletRequest" %> | | <html> | <head> | <title> | index | </title> | </head> | <jsp:useBean id="indexBeanId" scope="session" class="nnet.IndexBean" /> | <jsp:setProperty name="indexBeanId" property="*" /> | <body bgcolor="#008000"> | | | | Welcome <%= getName(request) %> | <form method="post"> | <br>Enter new value : <input name="sample"><br> | <br><br> | <input type="submit" name="Submit" value="Submit"> | <input type="reset" value="Reset"> | <br> | Value of Bean property is :<jsp:getProperty name="indexBeanId" property="sample" /> | </form> | </body> | </html> | <%! | private String getName(HttpServletRequest request) { | Principal user = request.getUserPrincipal(); | String name = user.getName(); | return name; | } | %>
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3831744#3831744 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3831744 ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
