Solved

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

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSum6 challenge 6 86
javap not working 8 46
JavaFX TableView not displaying correctly 3 20
Java Restore security prompts not working 10 16
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

831 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