Verifying access to each jsp

Hello!
I'm developing a web app in which users need to be authenticated.
Users have different profiles and, according the the profile, they may or may not have access to certain pages.
Some pages may be accessed by all user profiles while other pages may only be accessed by one or two profiles..
After the user logs on, I keep the profile in the session.
What is the best way to validate access to each jsp? My app has a big tendency to get bigger and bigger and to have more and more jsps, so I would like the solution to address this issue.
Any help is appreciated...
Nuno Geraldes

You can set up declarative security in your web.xml file.
Basically you have users and roles.
You can restrict access to html/jsp pages based on the role a user is logged in on.
Heres a basic extract from a project: sets up an admin folder, only available to those in the admin role.
This security is part of the servlet spec, and should be supported by all servlet containers.
For Tomcat, you may find this page on setting up realms useful.
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html
<login-config>
    <auth-method>FORM</auth-method>
    <form-login-config>
      <form-login-page>/login/login.html</form-login-page>
      <form-error-page>/login/loginerror.html</form-error-page>
    </form-login-config>
  </login-config>
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Admin Application</web-resource-name>
      <url-pattern>/admin/*</url-pattern>
      <http-method>GET</http-method>
      <http-method>POST</http-method>
      <description>Administration Application</description>
    </web-resource-collection>
    <auth-constraint>
      <role-name>admin</role-name>
      <description>Administrators Only</description>
    </auth-constraint>
  </security-constraint>Check out the J2EE tutorial Chapter 32 on Security.
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/Security.html#wp268799
Hope this helps,
evnafets

Similar Messages

  • Error: cannot access directory oracle\jsp\runtime

    I got this error when try to add a existing project to JDeveloper 9.0.3.4
    Error: cannot access directory oracle\jsp\runtime; verify that directory is reachable from classpath and/or sourcepath
    can someone help me?
    thanks

    Xinwei -
    Make sure you have added the correct libraries to your project; adding JSP Runtime to your project should alleviate this error.
    Hope this helps,
    Lynn
    Java Tools Team

  • HT204053 Our family has several apple devices, iPad, touch, and now iMac, our original iTunes are all under a different apple id.  do we keep our own accounts even in cloud? do we all have access to each others media? (First time out with all this..)

    Our family has several apple devices, iPad, touch, and now iMac, our original iTunes are all under a different apple id.  do we keep our own accounts even in cloud? do we all have access to each others media? (First time out with all this..)

    There is no problem about using one ID for iTunes, iTunes in the Cloud and iTunes Match, and another for iCloud and its email and syncing facilities. This way you can all use the same iTunes account but have separate emails and calendars etc.

  • Tried installing latest iTunes (10.5.3.3). During installation received error message asking to verify access to "C:\Config.Msi\187e500.rbf". The only option it gives is "try again" or "cancel". No choice but to cancel installation. Any suggestions?

    The problem started when my current iTunes kept popping up a window stating that my Auto Run was turned off. (which means iTunes will not be able to recognize when a CD is inserted or ejected). It asked if I wanted iTunes to run  Auto Run and I select Yes every time (this window pops up every time I open my iTunes), but a second window pops up stating iTunes cannot turn on my Auto Run setting (but it will still be able to recognize CDs) to which I choose okay. A third window pops up after stating that iTunes was not properly installed and if I wish to import or burn CDs I need to re-install iTunes, except that I can import CDs since I did this only yesterday and this problem has been going on at least a month.
    To add to this, I cannot cannot automatically update to version 10.5.3. (I don't recall which problem came first, my Auto Run problem or the fact that my iTunes can't update). iTunes suggested that I manually install the update, so I went to the apple site and tried manually installing the latest iTunes (10.5.3). However, during the installation process I received an error message. It asked me to verify access to "C:\Config.Msi\187e500.rbf". The only option it gives is "try again" or "cancel". I tried hitting Try again a few times but the same error message popped up, so I had no choice but to cancel the installation. Afterwards, I tried searching in my C drive but could not find "C:\Config.Msi\187e500.rbf"
    Does anyone have any suggestions how I can update my iTunes?

    I should have posted this earlier, but anyway. I restored my laptop to factory version after backing up any useful data, and the first thing I the laptop was restored was connect to the internet, download and install the latest version of iTunes. And Bingo! It worked.
    Apple helps you find Original Sin with the Windows.

  • Workflow to grant access to each List item based on a column value

    Hi,
    I have 2 lists Risks and RisksLookup.
    In Risks, I have Title, Description, service impacted and status columns.
    In RisksLookup, I have service impacted, AD1, AD2, AD3, AD4 and AD5.
    I have a requirement where in I have to write a Workflow to provide access to each List item based on the value of service impacted. i.e. If service impacted in Risks List is Client A, I have to lookup what all AD groups are present for Client A in RisksLookup
    List and provide access to only those groups for that item.
    Regards, Shreyas R S

    Hi
    another approach
    create 5 more lists, dedicated to each impacted service. for  Each one these lists apply needeed right ( based onAD groups )Keep you main list where first level will add new items . Attach a workflow to this main list, which will start when an item
    is added and which will add specific item's value to his new list ( based on impacted service value )
    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

  • 10.1.3.4 - how to secure access on a jsp page ?

    I have a simple jsp page that takes in some user values and then kicks off a workflow. I want to restrict the access on the jsp page so that only users of a certain group can use it. right now it is completely open and anyone can just go the page and start of a transaction.

    found an article on this
    http://www.oracle.com/technology/products/jdev/howtos/1013/adfsecurity/adfsecurity_10132.html

  • Location of the file accessed by OA.jsp

    Hi,
    I have the below url
    https://server.server.com/OA_HTML/OA.jsp?page=/oracle/apps/cz/cx/xxx/webui/AttributesValuesPG&retainAM=Y&enableHB=false&debugPath=&debugFile=&oas=dbJT9-mnVxU61nxwoJ5Qbw..
    But, not able to locate the directory /oracle/apps/cz/cx/xxx/webui/ in the unix server. Can someone help. I am trying to obtain the file AttributesValuesPG that is being accessed by OA.jsp.
    Thanks.

    Hi Shankar,
    Under JAVA_TOP you can find the class files only.
    For the .xmls we have to go for MDS.
    You are trying to access a custom developed page.
    All page definitions will reside under MDS.
    So Please perform the following Steps in Putty or WINSCP
    cd $APPL_TOP/cz/11.5.0/mds/cx/xxx/webui
    Here you can find the required .xml page.
    Ex:/eebsmt/orasoft/appl/cz/11.5.0/mds/cx/tso/webui
    Hope this will resolve your problem.
    Regards,
    Palepu

  • Error: cannot access class oracle.jsp.runtime.HttpJsp; file oracle\jsp\runtime\HttpJs

    Hello,
    where is now oracle\jsp\runtime\HttpJsp.class located?
    thanks.
    Oleg.

    Same problem,
    Error: cannot access class oracle.jsp.runtime.HttpJsp; file oracle\jsp\runtime\HttpJsp.class not found
    Thanks
    aldo

  • I am trying to upgrade to itunes 10.7 using windows and keep getting the following error message: "Error writing to file: C:\Config.Msi\364460.rbf   Verify access to this dierctory". Help!

    I am trying to upgrade to itunes 10.7 using windows and keep getting the following error message: "Error writing to file: C:\Config.Msi\364460.rbf   Verify access to this dierctory". Help!

    Fixed! (win7 64 bit)! Just stop your antivirus during the upgrade/installation (I've got Kaspersky).
    Good luck!

  • Reg : Checking for userLogin in each JSP using Filters

    Hi,
    To check for UserLogin in each JSP page i am using a filter.
    1) -downloaded accessflt.jar
    2) added the below in web.xml
    <filter>
    <filter-name>AccessFilter</filter-name>
    <filter-class>com.cj.accessflt.AccessFilter</filter-class>
    <init-param>
    <param-name>attribute</param-name>
    <param-value>OK</param-value>
    </init-param>
    <init-param>
    <param-name>redirect</param-name>
    <param-value>/index.jsp</param-value>
    </init-param>
    <init-param>
    <param-name>except</param-name>
    <param-value>/index.jsp</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>AccessFilter</filter-name>
    <url-pattern>/faces/*.jsp</url-pattern>
    </filter-mapping>
    3) when User logged in Setting
    session.setAttribute("OK","yes");
    I am getting the below error
    javax.servlet.jsp.JspException: Cannot find FacesContext
         at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:427)
         at com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:125)
    Can anybody help me please,
    i will appreciate your help.
    Thanks,
    Sudha.

    Hi,
    I am doing any fundamental mistake??
    please anybody help or can u please tell me how to handle this situation
    when user hits any JSP needs to check wether he logged in or not.
    if he is not login needs to redirect to Login URL.
    read the previous posts but i am not clear
    please anybody help me
    Thanks,
    Arthi

  • Adding web page in Adobe Muse that can be accessed from each web page

    I have a disclaimer link at the footer of each of my web pages, I want it ot be accessed from each page. Where in Adobe Muse do I insert this page?

    I'm new to Muse so two more questions for you all--
    1. How do I add a drop down menu feature to my navigation menu to show the sub navigation?
    2. How do I insert a Contact Form so that people can fill it out and send to us via email through our website?
    Thanks!

  • 2 SSD / 2 OS - Without access to each other

    Hi guys.
    I need some help from you.
    I have a MacBook Pro (Mid 2009) with two SSD, Samsung SSD 256GB 840 PRO and Samsung SSD 250GB 840 EVO. An SSD in place of the original HDD and the other in place of SuperDrive.
    I want to install OS X Mavericks on the SSD 840 PRO 256GB and OS X Snow Leopard on SSD 840 EVO 250GB, I know do this
    What I need is when i'm on OS X Mavericks cannot access the disk/data where is installed OS X Snow Leopard and the same on OS X Mavericks.
    How I do I do it?
    Sorry for my English and I thank you for your help.
    Best Regards

    I apologize, I didn't explain myself in the best way.
    The protection was not because of other people access to my MacBook Pro, I am the only one using the laptop.
    Due to my profession i need to have OS X Mavericks (SSD 840 PRO) clean, and only with the required software and files to work. The other disk (SSD 840 EVO) would be for personal use.
    If the disks (OS X) have access to each other, will create problems and incompatibility. I've tested and had some problems with the software folder locations.
    With FileVault active, don't have a big difference in reading and writing to disk. Uses lots of CPU.
    Due to use much CPU I'm not very interested in using FileVault.
    The method mentioned by Network 23 seems like a good solution. Beyond that, there is any more similar?
    Again, thanks for the help provided.
    Best Regards.

  • How to access dataprovider through jsp syntax

    I am creating an image gallery but here's my issue...
    I have a database table that contains links to images on my file system. I created a dataprovider for this database table on my page so the dataprovider now returns all the image links.
    Now what I need to do is create a row of thumbnails so I add a scriptlet in my jsp code where I want the thumbnail to appear. This scriptlet loops through the dataprovider and for each row it will create a standard html image tag populating the src attribute with the link from the dataprovider.
    I figure creating dynamic html img tags is much easier than creating dynamic image components in the backing bean. Doing the former allows me to output the row of thumbnails exactly where I want them on the page (ie where i put my scriptlet code) and is easier to manage.
    The problem is i don't know how to access the dataprovider through jsp tags and syntax. I'm sure there must be a way, can anyone help?
    Thanks.

    I've done this sometimes using scriplets:
    <%
        request.setAttribute("SOME_CONST", Constants.SOME_CONST);
    %>
    <c:out value="${SOME_CONST}" />But I would also be interested if anyone knows a way without those ugly scriplet..
    O

  • How can I keep the name of the user around for each JSP without asking user

    I have a number of JSP pages that I give the user access to once they login successfully. I want to be able to keep the name of the user present on every page without having to ask them for it each time.
    How can I do this? Currently I have a user object that is access through use of a request bean in my JSP's.
    Any suggestions???

    Thanks for the help. A few questions though...
    Can you just clarify how the 2 different SessionTest2.jsp's differ. I am right in thinking that the second one will instantiate a new bean object which if I do every time I go to the page, I will be getting the same name but in a different session each time. In the first SessionTest.jsp, I get the same name but from the same session object each time??
    Please clarify???
    SessionTest1.jsp
    <%@ page language="java" import="test.*" %>
    <jsp:useBean id="testBean" scope="session"
    class="test.TestBean" />
    <jsp:setProperty name="testBean" property="name"
    value="ZZZZZ" />
    <jsp:setProperty name="testBean" property="status"
    value="Married" />
    <%
         response.sendRedirect("SessionTest2.jsp");
         return;
    %>
    SessionTest2.jsp
    <%@ page import="test.*" %>
    <jsp:useBean id="testBean" scope="session"
    class="test.TestBean" />
    <%
    out.println("User Name is : "+testBean.getName());
    %>or SessionTest2.jsp
    <%@ page import="test.*" %>
    <jsp:useBean id="testBean" scope="session"
    class="test.TestBean" />
    <%
    TestBean testBean =
    (TestBean)session.getAttribute("testBean");
         out.println("Name is : "+testBean.getName());
    %>Hope this helps.
    Sudha

  • Database access using HTML, JSP, JavaBean, & Access

    I am trying to create an HTML page that a user logs into and can choose to query, add, delete or modify a specified database. I have created the HTML, the JSP, and access database but I can't figure out how to have 4 different JSP pages(one for each option) to get information from one JavaBean. PLEASE HELP

    http://swforum.sun.com/jive/thread.jspa?threadID=53106&tstart=0

Maybe you are looking for

  • Call transaction in subscreen

    Hello, I have a requirement to build a screen with custom functionality, and in the lower part of the screen to have standard functionality of a transaction. How can I call that transaction in order to have my functionality also on the same screen? T

  • Gradient feather display problem in browser

    Hi, I have two images/photos to which I applied a gradient feather effect. The documment printed fine, but when the PDF is viewed online in Fire Fox, the gradient feather no longer displays and only the sharp edges of the photo are visible. Is there

  • Itunes visualizer on music playback with apple tv

    Do any of you clever people out there know if it's possible to have the itunes visualizer playing on the TV instead of a photo slide show? I can get it working if I wired the TV directly to my macbook pro but not when I link it through the apple tv.

  • App purchase error.

    Everytime when I download/purchase an app from the app store, I always receive this error. Can anyone help?

  • StringIndexOutOfBoundsException with SAX

    Hi, Am facing this error: "StringIndexOutOfBoundsException - string index out of range -84" while parsing a file using Java SAX parser I am hitting google adwords API and from the response data, am writing a xml which i then parse to get its data and