This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to set userProfile info in  WebApp" Watch "how to set userProfile info in  WebApp" New topic

how to set userProfile info in WebApp

Ray Lim

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
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

Joined: Mar 22, 2000
Posts: 12982
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.
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 ) 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: 16895

I believe Cactus from the Jakarta Project ( 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:
subject: how to set userProfile info in WebApp
It's not a secret anymore!