Web.xml informations
I have just finished to write my web-application, I developed everything on Netbeans using Tomcat 5.0.
As you should know I have a .war archive with my web application inside.
I was wondering if I'd change the application-server (I mean the web engine that compiles the sources) for example using JBoss in stead of tomcat, would it keep working?
Is .war archive an extension recognized by all Java application servers?
Do I have any risk that my application will not work on another app.server?
Hope somebody could help.
Peppe.
In WebSphere App. Server you have three options for storing user information (user name and passwords).
1. LDAP server (any supported by WAS)
2. You can use local operating system or domain accounts.
3. You can implement inteface com.ibm.websphere.security.CustomRegistry
This interface has ~14-16 methods, like getUsers(), getUser(String), checkUserPassword(String user,String password)... etc
If you choose 3rd option - you obviously have to write a class with all these methods, and its really limited only to your imagination where you store user info in this case:)
Oleg.
Similar Messages
-
How to get information of error configuration in web.xml
Hi
Is there an API in the Java Servlet API that can give me information on the <error> tags of the web.xml.
Regards,
N�stor Bosc�nThat is XML file why u dont try JAXP (SAX) i.e XML parsers for that file
;) -
Hi,
In one of the example my web.xml looks like this
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>com.sample.MyServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
[\code]
Please tell me what exactly is that debug and detail parameter.Those are initialization parameters which are apparently to be expected by the servlet in question. Hard to say the details without knowing the details of the servlet. Just read the (java)docs which come along with the servlet for details.
-
How to give relative path in web.xml?
Hi All,
Im creating a servlet which has to load the properties file.
I don't want to give the location of the properties file as ABSOLUTE PATH. But I'm unable to provide the same as RELATIVE PATH.
When I give the path is given as ABSOLUTE PATH (drive:/dir/) it is working. But if I give the RELATIVE PATH(../), the same is not working.
Kindly help me in this.
Regards,
Kumar Madhavan.
My web.xml file is:
<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<display-name>NGT - ASCII</display-name>
<description>Application for Safety Critical Information vIew.</description>
<welcome-file-list>
<welcome-file>ASCII.html</welcome-file>
</welcome-file-list>
<context-param>
<param-name>asciifiledir</param-name>
<!-- This is the tag in which I would like to
<param-value>../</param-value>
</context-param>
</web-appHi.
Exclude the directory path from the <param-value/> in
the web.xml and just keep the property file name.
Place the property file in the classpath and load it
like this from the servlet:
Properties props = new Properties();
String propFileName = "" // Read param-value from web.xml
try {
InputStream is = TheServlet.class.getResourceAsStream(propFileName);
props.load(is);
} catch (Exception ex) {
System.out.println("Prop file not in classpath!");
/Jesper -
Error trying to update web.xml
I'm trying to update web.xml via these instructions:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0eb8120-b66c-2910-5795-894f384fc054
The upload fails, and I see this excetpion in the log:
Caused by: java.rmi.RemoteException: Error occurred during single file update of
application sap.com/irj. Reason: Updating the security information in the
deployment descriptors is not allowed in this operation.; nested exception is:
com.sap.engine.services.servlets_jsp.server.exceptions.WebDeploymentException:
Updating the security information in the deployment descriptors is not
allowed in this operation.
Ideas? I'm signing in as Administrator, so why would the operation not be allowed?
This is a 7.0 system, and the instructions are for a nw2004 system. We've successfully uploaded the web.xml file before, so I'm thinking that something has changed in 7.0 that's preventing the upload.This page of the documentation indicates that the technique is the correct case:
http://help.sap.com/saphelp_nw70/helpdata/en/6e/8590f1d6d349c9adc34c6a8085189b/frameset.htm
So, one of two things has happened:
1. The documentation is in error, or
2. A bug has been introduced.
I'm hoping it's #2.... -
How to configure ADF application to use OAM Identity Assertion ? web.xml
We have a web application developed using ADF (application development framework) and deployed on WebCenter 11.1.1.2 (weblogic 10.3.2)
OID Authentication and OAM identity assertion is configured in WebLogic 10.3.2 .
How to configure security in ADF application (web.xml or weblogic.xml) so that it uses OAM identity assertion (already configured as authentication providers in weblogic server)
Any pointers or documentation so that application (developed using ADF) check for identity tocken and verifies it with one of identity assertion providers.John,
I have to concur. With OAM you don't need this. OAM intercepts the calls and inserts a cookie for WLS to get user information from.
I strongly advise to go through the above mention OFM Security Guide. Esp. Chapter 10 tells you in every detail how to implement OAM SSO with WLS (with or without OHS as a proxy).
Reading this chapter saves you time and turnarounds on this topic...
--olaf -
Need api for changing security role in web.xml !!
My requirement is to change the value of the deployment descriptor "security-role" (in web.xml) through an api and inturn to persist the new value in web.xml. Also I need to know if this change is automatically redeployed or an explicit redeployment is needed ? In that case how do I redeploy using an api call ?
I found a lot of apis related to roles like createRole, removeRole etc.. But there are no apis to change the name of the role and inturn persist in web.xml.
Do I need to provide any more information ? Let me know
Thanks,
Karthickwhy and when do you change security-role? try to use ant task (perhaph you need xpath also). it´s the better when you perform task about life´s cycle of application.
please, describe your problem.
of course in you change web.xml you must restart the application. -
Web.xml problem ????
This is my web.xml file :==>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
<web-app>
<servlet>
<servlet-name>chatAdmin</servlet-name>
<servlet-class>ChatAdminServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>chatRoom</servlet-name>
<servlet-class>ChatRoomServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>listRooms</servlet-name>
<servlet-class>ListRoomsServlet</servlet-class>
</servlet>
<context-param>
<param-name>ADMIN_PATH</param-name>
<param-value>/ChatApplication/servlet/chatAdmin</param-value>
</context-param>
<context-param>
<param-name>LISTROOMS_PATH</param-name>
<param-value>/ChatApplication/servlet/listRooms</param-value>
</context-param>
<context-param>
<param-name>CHATROOM_PATH</param-name>
<param-value>/ChatApplication/servlet/chatRoom</param-value>
</context-param>
</web-app>
Error after starting Tomcat in above file:-
Starting service Tomcat-Standalone
Apache Tomcat/4.0.1
PARSE error at line 38 column 11
org.xml.sax.SAXParseException: The content of element type "web-app" must match "(icon?,display-name?,description?,
distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page
*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
Starting service Tomcat-Apache
Apache Tomcat/4.0.1
I am not getting where is error exactly please inform .<web-app>
<servlet>
<servlet-name>chatAdmin</servlet-name>
<servlet-class>ChatAdminServlet</servlet-class>
</servlet>[snip]
<context-param>
<param-name>ADMIN_PATH</param-name>
<param-value>/ChatApplication/servlet/chatAdmin</param>
</context-param>
[snip]
org.xml.sax.SAXParseException: The content of element
type "web-app" must match
"(icon?,display-name?,description?,
distributable?,context-param*,servlet*,servlet-mapping*
session-config?,mime-mapping*,welcome-file-list?,error-
ageThe error message specifies exactly what is wrong -- namely your context-param tags need to come before your servlet tags which need to come before your servlet-mapping tags, etc...
ncuka -
error-page in web.xml not working
In my web.xml I have
<error-page>
<exception-type>java.lang.NullPointerException</exception-type>
<location>/error.jsp</location>
</error-page>
I checked the page works by doing a /context/error.jsp and
the page displays fine (it is a simple jsp page).
I hit a struts action that gives me this in the std output.
06/29 10:48:24 error
[1]java.lang.NullPointerException
at
com.pearson.gs.cms.business.LoginService.verifyPassword(LoginService.java:232)
at
com.pearson.gs.cms.action.LoginAction.performCMSAction(LoginAction.java:92)
at
com.pearson.gs.cms.action.BaseCMSAction.execute(BaseCMSAction.java:48)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:259)
at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
at
jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
[0]javax.servlet.ServletException
at
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:259)
at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
at
jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
I get a 500 error page instead of my /error.jsp page.
I tried adding
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
but that doesn't work either.
JRun 4.0
Updater 6
JDK 1.4.2
Struts 1.2.8
Any ideas what to try?a. Override your skeletons error.jsp to forward/redirect to your page.
or
b. If you primarily use pageflow portlets Define a shared flow which has an exception handling method and direct it to your page. Reference the shared flow in each of your controllers (i think global.app is deprecated in 10 otherwise you could do this there). this lets you log some additional information, plus gives you the added flexibility of dealing with different exception types
or
c. Override the path to error.jsp in your portlets properties (havent tested)
Note if you are using servlets etc you still need your web.xml java.lang.Exception entry. The reason it doesnt get picked up is because the portal framework is handling the exception
Edited by: deepshet on Dec 22, 2008 8:12 PM -
What is the best way to find a file on the servers disk without using web.xml?
What is the best way to find a file on the servers disk without using web.xml?
I want to find a configuration file not contained within the war file I have
created. Is there a way to pass information into the ServletContext with out
rebuilding the ear or war files? Tomcat 4.0 can do this in its server configuration
files. Does BEA have the equivalent?
Regards,
Eric
You can specify the path to the file as a system property
eg
java -Dconfig.file.location=./mydirecotry/myfile.txt com.test.MyApp
"Eric White" <[email protected]> wrote in message
news:[email protected]..
>
> What is the best way to find a file on the servers disk without using
web.xml?
> I want to find a configuration file not contained within the war file I
have
> created. Is there a way to pass information into the ServletContext with
out
> rebuilding the ear or war files? Tomcat 4.0 can do this in its server
configuration
> files. Does BEA have the equivalent?
>
> Regards,
> Eric
-
Web.xml file generation problem
Hi,
I am trying to create web.xml file automatically using "java weblogic.marathon.ddinit.WebInit
" command.
I got the following message in the command prompt:
Found Web components. Initializing descriptors
filters=0 servlets=0 tags=0
Above command is creating the web.xml and weblogic.xml files but it is not including
the servlet-mapping information. why?
Thanks,
PrakashIt doesn't look like it found any servlets. You'd have to show me your
files if I'm to understand what's going on.
-- Rob
Prakash wrote:
Hi,
I am trying to create web.xml file automatically using "java weblogic.marathon.ddinit.WebInit
" command.
I got the following message in the command prompt:
Found Web components. Initializing descriptors
filters=0 servlets=0 tags=0
Above command is creating the web.xml and weblogic.xml files but it is not including
the servlet-mapping information. why?
Thanks,
Prakash -
How can I change application's web.xml in NetWeaver CE 7.1?
Hello Experts,
Please help me. I need to configure a J2EE application on NetWeaver 7.1, but I don't know how I can change the web.xml of the application.
The web.xml of the app needs to be modified during the configuration. This can be achieved via single-file-update in VA in Netweaver 6.4 or 7.0. But I cannot figure out how to do that in NW 7.1.
Please show me how to do that or at least give me some hints.
Thank you!
JackHi Jack,
In SAP NetWeaver 7.1 and later, you use the SAP NetWeaver Administrator instead of Visual Administrator.
To get some information on how to configure web applications, try [THIS|http://help.sap.com/saphelp_nwce10/helpdata/en/45/48a60a528608d1e10000000a11466f/frameset.htm] piece of documentation.
I hope it helps.
Best,
Yordan -
J_security_check and web.xml
Hi,
I've set up a web application with form authentication
Here's part of my web.xml:
<security-role>
<description>user</description>
<role-name>user</role-name>
</security-role>
<!-- Login Authentication -->
<security-constraint>
<display-name>Secure User Pages</display-name>
<web-resource-collection>
<web-resource-name>SecureUserPages</web-resource-name>
<url-pattern>/jsp/welcome.jsp</url-pattern>
</web-resource-collection>
<auth-constraint>
<description>user</description>
<role-name>user</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/jsp/login.jsp</form-login-page>
<form-error-page>/jsp/loginError.jsp</form-error-page>
</form-login-config>
</login-config>When I request welcome.jsp, I'm taken to login.jsp.
If I enter an incorrect login/password combo, the contents of loginError.jsp show up, but the url says http://hostname:port/appname/jsp/j_security_check
How can I make it so that the url does not show 'j_security_check', but 'loginError.jsp'?
Second, if I enter a correct login/password combo, I am not taken to the page I requested - I stay on the login page, but the information in the form fields gets wiped out. According to my logs, it says that I logged in correctly.
Can someone shed some light on these one or both of these issues?
Thanks in advance,
CTo answer you,
1. j_security_check servlet forwards the request to loginError.jsp on login failure. Hence you don't see any change in URL at the address bar. Use redirect at your application level to see the change in URL at the address bar.
If you want to attain some more flexibility at the login level, probably JAAS can help you out.
2. _"Second, if I enter a correct login/password combo, I am not taken to the page I requested - I stay on the login page, but the information in the form fields gets wiped out. According to my logs, it says that I logged in correctly"_
If you're really sure about correctness of your log, i think, you have directly invoked login.jsp from your browser and then you must have entered a valid username/password.May be this is the reason you get to see login.jsp again on successful login.
Solution, would be to directly invoke welcome.jsp from browser.Provide valid username and password and then see whether you really get to see welcome.jsp or not? -
JSF 1.2 web.xml configuration parameters
Actually, I know these JSF 1.2 web.xml configuration parameters:
javax.faces.CONFIG_FILES
javax.faces.DEFAULT_SUFFIX
javax.faces.LIFECYCLE_ID
javax.faces.STATE_SAVING_METHOD
Are there any more available?
(I have to study its performance implications in conjunction with RichFaces ones).The JSF 1.2 specification document would contain the information you're looking for.
-
Can someone please tell me how the <servlet> entry differs from
weblogic.httpd.register.snoop=examples.servlets.SnoopServlet
in weblogic properties?
Do these perform identical functions?
Yes this is the source of my confusiong. It seems to be that WL can be told
about servlets
two ways. Firstly through the web.xml file and also via weblogic.properties.
I don't understand
why the second one exists.
"Cameron Purdy" <[email protected]> wrote in message
news:[email protected]...
> I only work with WAR files, so I cannot speak to non-WARd servlets with
any
> confidence. I know that WL could use web.xml for non-WARd servlets in
order
> to obtain the other information associated with the servlet:
>
> <!ELEMENT servlet (icon?, servlet-name, display-name?, description?,
> (servlet-class|jsp-file), init-param*, load-on-startup?,
> security-role-ref*)>
>
> --
>
> Cameron Purdy
> http://www.tangosol.com
>
>
> "Robert Nicholson" <[email protected]> wrote in message
> news:[email protected]...
> > If what you say is true then why is there the need to also tell WL about
> the
> > servlets themselves?
> >
> > Presumably this is for when the servlets exist outside of a WAR then?
> >
> > "Cameron Purdy" <[email protected]> wrote in message
> > news:[email protected]...
> > > The weblogic.properties tells WL to load a WAR or specific servlet.
The
> > > <servlet> entry (I assume you refer to
> > > http://java.sun.com/j2ee/dtds/web-app_2_2.dtd) defines the presence of
a
> > > servlet within a WAR (a deployment unit):
> > >
> > > >
> > > The servlet element contains the declarative data of a
> > > servlet. If a jsp-file is specified and the load-on-startup element is
> > > present, then the JSP should be precompiled and loaded.
> > > [end-quote]
> > >
> > > In the case of a WAR deployment, you have to tell WL that the WAR
> exists,
> > > then it will look in the WAR and figure out what servlets are there
from
> > the
> > > <servlet> tags in your web.xml. You set up a WAR in the
> > weblogic.properties
> > > as such:
> > >
> > > weblogic.httpd.webApp.<http-path>=<os-path>
> > >
> > > For example:
> > > weblogic.httpd.webApp.website=c:/weblogic/website.war
> > >
> > > --
> > >
> > > Cameron Purdy
> > > http://www.tangosol.com
> > >
> > >
> > > "Robert Nicholson" <[email protected]> wrote in message
> > > news:[email protected]...
> > > > Can someone please tell me how the <servlet> entry differs from
> > > >
> > > > weblogic.httpd.register.snoop=examples.servlets.SnoopServlet
> > > >
> > > > in weblogic properties?
> > > >
> > > > Do these perform identical functions?
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Maybe you are looking for
-
Can the WLPI be used for a perl web site
We have a client, which has a perl(Apache/mod_perl) based web site. Cutomers submit orders on the web site and right now there is an order-processing system, but the client is looking for workflow/process product which will ease with all this order p
-
Vista 64 bit and CS4 and color management
This is a question about Vista 64 bit and CS4 and color management. I scan 4x5 film and sometimes end up with up to or even bigger than 1 GB files. Obviously that needs as much memory as possible. Windows XP is limited in this regard and I am in the
-
OCS 10.1.2 on Win2003 - mail application cannot start after rebooting serve
Hi We have installed OCS 10.1.2 on Win2003 (single box) and the mail appln was running OK after the installation. On rebooting the server, we found some components that were not started (eg Internet directory for Infra) which we started manually via
-
Trackpad & Connection Lost Issue
I'm not sure whether this post belongs in the connectivity area or this one, but since I'm not trying to connect anything I think it belongs here. My laptop started to concern me today as my trackpad started to act up. I have been experiencing episod
-
Where can I purchase Apple TV 3rd gen power cord?
Hi. Where can I purhcase a power cord for my Apple TV 3rd generation (released in 2012)? I don't see it on apple.com or amazon or ebay. Weblinks would be very helpful in your reply. Thanks!