aspose file tools*
The moose likes Servlets and the fly likes how to set userProfile info in  WebApp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to set userProfile info in  WebApp" Watch "how to set userProfile info in  WebApp" New topic
Author

how to set userProfile info in WebApp

Ray Lim
Greenhorn

Joined: Jan 10, 2002
Posts: 15
For testing purposes, I want to create a servlet or JSP to simulate that my session is of a logged-in user.
In a sense by running the servlet/jsp, it would log my session in and setup the
session.getId()
request.getRemoteUser()
request.getUserPrincipal()
roles for the request.isUserInRole(role) check
Sort of like an auto-login.... Is this possible?
ps. I am already using form-based authentication against an LDAP in Tomcat 4.
[ February 04, 2002: Message edited by: Ray Lim ]
[ February 04, 2002: Message edited by: Ray Lim ]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
I think that for testing purposes you would be much safer writing an automated client that makes a URL connection and simulates a browser. Thats the only way to get a real request object.
Bill
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Or, write a wget script.

there is also testing software out there (one example is by www.mercuryinteractive.com ) that allows you to record web-site interactions, and then run them back as a test.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16012
    
  19

I believe Cactus from the Jakarta Project (http://jakarta.apache.org) is supposed to extend the JTest platform to server testing.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to set userProfile info in WebApp