Joe Barefoot wrote:
Shouldn't matter where the login.jsp file is....Hi
After clicking the link, does the link at the top right of the page say "Edit account:anon"? In other words, are you sure it's the anon user that's logged in? If it is, it means that the login must be failing for some reason. Check the log files not just for errors, but to see if Jetspeed is denying the login request, or ignoring it entirely.
Are you sure that the user/password are properly created in Jetspeed's database?
Try adding some debugging statements before and after the login action in your JSP:
User user = runData.getUser();
System.out.println("Jetspeed user: " + user.getUserName());
System.out.println("user password: " + user.getPassword();
This should tell you whether the user is getting logged in correctly or not.
If you still can't get this to work, you may have to ask if anyone else does this a different way, as this works in our application...
--joe
thanks for the help
i am using vm as the template
what i did is crated a Login.jsp file with the code you sent me.
put that file in the jetspeed root folder.
crated a link href="Login.jsp" on the default page.
i am hard coding the username and password in the Login.jsp file.
so when i click on the link it goes to Login.jsp but shows up the default page for the user anon
there is a user folder also
and in think it automatically copies the psml file from the anon user folder.
should the login.jsp file be in some other folder or should it be in the vm template folder?
there is no error in the log files.
please help me
thanks
Login.jsp file has this code
but when i print the user name it prints anon everytime
is something wrong with the code?
please help me out
<%@ taglib uri='/WEB-INF/templates/jsp/tld/template.tld' prefix='jetspeed' %>
<%@ page import = "org.apache.turbine.util.*" %>
<%@ page import = "org.apache.turbine.services.resources.TurbineResources" %>
<%@ page import = "org.apache.turbine.om.security.User" %>
<%@ page import = "org.apache.turbine.util.RunDataFactory" %>
<%@ page import = "org.apache.turbine.util.RunData" %>
<%@ page import = "org.apache.turbine.modules.ActionLoader" %>
<%
String username = "turbine";
String password = "turbine";
RunData runData = RunDataFactory.getRunData(request, response, config);
ActionLoader.getInstance ().exec( runData, "JLogoutUser" );
runData.getParameters ().setString ( "username", username );
runData.getParameters ().setString ( "password", password );
User user = runData.getUser();
// verify that the user is logged out before logging them in
System.out.println("The user name is :"+user.getUserName());
if(user == null || !user.hasLoggedIn() )
{
// Execute the login action.
ActionLoader.getInstance ().exec( runData, "JLoginUser" );
}
// redirect to the Jetspeed portal servlet....
response.sendRedirect(request.getContextPath() + "/portal");
%>
Thanks
sangam dash
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
