Solved

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

Posted on 2004-10-06
2
269 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Apps blocked by Java 9 63
xampp tool 12 26
table example 4 24
Opening PDF on button click and fill new document 2 21
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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 will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

920 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

14 Experts available now in Live!

Get 1:1 Help Now