Solved

Restrict acessing staic data inside ear file using URL's in Websphere

Posted on 2004-10-06
2
266 Views
Last Modified: 2008-03-06
Hello,

We are using WAS 5.0 Base edition. Our site is form based log on. So When acessing JSP pages pages then we know whether used is signed or not using session object.

I need to implement security while acessing statics data inside EAR file. Static data PDF's word documents etc.

My questions are

1. When user types direct URL for document, then how can I check whether user is signed on to our website ot not?
2. How can expire documents viewd by user so that he won't book mark the URL's

I thinking J2EE security for acessing WEB-INF folder inside EAR file. But I am not aware what I need to do or where I can find the documentation.

Thanks in advance
Prasad
0
Comment
Question by:l_prasad
2 Comments
 
LVL 8

Accepted Solution

by:
kiranhk earned 50 total points
ID: 12243452
Hi,
You can restrict direct access to pages from the web.xml

just check out the http://www.onjava.com/pub/a/onjava/2001/08/06/webform.html
it will explain all abt the steps

<security-constraint>
<web-resource-collection>
  <web-resource-name>SecurePages</web-resource-name>
  <description>Security constraint /secure</description>
  <url-pattern>/secure/*</url-pattern>
  <http-method>POST</http-method>
  <http-method>GET</http-method>
</web-resource-collection>

you can add the above in your web.xml to restrict direct access to the web pages.

hope this helps

Kiran
0
 
LVL 1

Expert Comment

by:jLasitha
ID: 12246686
1)You can hold loggin information in a session. As a example create a instance that can hold logged-in user info.( ex: CLogin class ).In loggin page you can add user info to the instance and add it to the session( ex: session.setAttribute( "LoginInfo" , loggin info instance ).In each page check the session and obtain the instance.If the user is not loggin he you will get a null object.If it's null you can redirect the page to the login page

if( session.getAttribute( "LoginInfo" ) == null )
{
 responce.sendRedirect( "login.jsp");
}

2) same way..you can colllect the data each time and maitain a info instance in your session.check it each time you want
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now