December 9, 2014 at 5:52 pm #1819tjholmes66Participant
I’m new to OpenAM, but not new to Java or Tomcat JSP pages, or servlets. We are using OpenAM ver. 10 I believe.
We can login to our loadbalancer which takes us to the url:
I can see where this page is located in the tomcat/webapps/sso/config/auth/html/Login.jsp
I just want to create a new jsp page in the same directory, but when try to go to the exact URL (https://myapp.net:9443/sso/config/auth/html/mytest.jsp), the JSP page just gives us all kinds of errors.
When I try to run the page as: https://myapp.net:9443/sso/UI/mytest.jsp gives me a bunch of errors.
I’d like to run the code this way? Do I have to create a servlet rather than create a jsp page.
BTW, I notice I get the same errors form I try the other standard jsp pages like session_timeout.jsp.
So, I am not sure if this is an OpenAM issue with configuration, or is this just a simple tomcat issue?
Any help would be much appreciated. Thanks!December 10, 2014 at 3:14 pm #1866Nicolas SeigneurParticipant
For anything under /openam/UI/* this is indeed done through a servlet-mapping.
/openam/WEB-INF/web.xml <servlet> <servlet-name>LoginServlet</servlet-name> <servlet-class>com.sun.identity.authentication.UI.LoginServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>LoginServlet</servlet-name> <url-pattern>/UI/*</url-pattern> </servlet-mapping>
For pages like session_timeout.jsp they’re called through callbacks from the Login page.
Do you really need to reside under /UI/*? I usually simply drop a JSP at the root of the WebApp and invoke it at /openam/test.jsp or in your case at /sso/test.jsp.December 11, 2014 at 10:01 am #1877Peter MajorModerator
One another important snippet from web.xml:
<context-param> <param-name>jato:com.sun.identity.authentication.UI.*:moduleURL</param-name> <param-value>../UI</param-value> </context-param>
Essentially endpoints matching the URL pattern of /UI/* will be captured by JATO’s LoginServlet, which will then do its own thing, and then forward the request to the corresponding ViewBean class (where the class name is determined by the path used, so /UI/Login will call LoginViewBean, and /UI/Logout will call LogoutViewBean).
The ViewBean then does its own magic, and getDisplayURL will be invoked, which then will return the path to the JSP file (normally something like /config/auth/default/Login.jsp – depends on ResourceLookup class to determine which customized path fits the most), and then the returned JSP will be executed.
Anyways, if you want to expose a custom JSP, the simplest thing would be to put it on the servlet context, and make sure its path doesn’t clash with a servlet-mapping in web.xml.
- This reply was modified 7 years, 8 months ago by Peter Major.
You must be logged in to reply to this topic.