Solved

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

Posted on 2004-10-06
2
277 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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 will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

623 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