File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 12675
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.

Java Resources at
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: 15632

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
Similar Threads
This thread is open for hijacking
What class must an inner class extend
what is session ?
how to control redirect of j_servlet_check
Impl Front Controller Pattern on root level