Help with web.xml under WL5.1sp3
Hello,
I just started to explore Weblogic Server 5.1sp3 as part
of setting it up for the JASIG uPortal project here at UBC.
I'm unable to get web.xml to work for me. I've created the
file, I know WL is seeing it and parsing it (through various
typos during the installation process) but when my index.jsp page
runs, getInitParameter() comes back with nothing.
Any ideas what I could be missing?
Thanks
George
[email protected] ITServices, UBC
Programmer/Analyst
phone: 604.822.4375 fax: 604.822.5116
Please post this to the weblogic.developer.interest.servlet
thanks
mbg
In article <[email protected]>, [email protected] says...
Hello,
I just started to explore Weblogic Server 5.1sp3 as part
of setting it up for the JASIG uPortal project here at UBC.
I'm unable to get web.xml to work for me. I've created the
file, I know WL is seeing it and parsing it (through various
typos during the installation process) but when my index.jsp page
runs, getInitParameter() comes back with nothing.
Any ideas what I could be missing?
Thanks
George
==================================================
NewsGroup Rant
==================================================
Rant 1.
The less info you provide about your problem means
the less we can help you. Try to look at the
problem from an external perspective and provide
all the data necessary to put your problem in
perspective.
Similar Messages
-
Help with web.xml and deploying a servlet
Hello,
I've been tearing me hair out for the last few hours trying to get this to work... I've got a servlet org.fatbaob.servtest.Servtest that I want to deploy with Tomcat 4.0.4. It doesn't seem to mater what I put in the web.xml file I'm always getting 404 errors.
The servlet is contained in a file c:\development\projects\servtest\WEB_INF\classes\org\fatboab\servtest\Servtest
which mapped with a <context> tag in the Tomcat conf\server.xml file:
<!-- Servtest context -->
<Context path="/servtest" docBase="C:\development\projects\servtest" debug="0" privileged="true" reloadable="true">
<Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_servtest_log." suffix=".txt" timestamp="true"/>
</Context>
My web.xml file contains:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>ServTest</servlet-name>
<servlet-class>org.fatboab.servtest.Servtest</servlet-class>
</servlet>
</web-app>
Although I have tried putting in <servlet-mapping> tags, but they didn't seem to work either.
My html file contains:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Servlet Test</title>
</head>
<body>
<h1>Servlet Test</h1>
<form action="/servtest/servlet/org.fatboab.servtest.Servtest" method="post">
<table>
<tbody>
<tr>
<td>Name:</td>
<td><input type="text" size="77" name="name" /></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" size="77" name="email" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Submit" /></td>
</tr>
</tbody>
</table>
</form>
</body>
</html>
The 404 error I get is:
description The requested resource (/servtest/servlet/org.fatboab.servtest.Servtest) is not available.
Help!
Cheers,
Bob.Hello,
I've been tearing me hair out for the last few hours
trying to get this to work... I've got a servlet
org.fatbaob.servtest.Servtest that I want to deploy
with Tomcat 4.0.4. It doesn't seem to mater what I put
in the web.xml file I'm always getting 404 errors.
The servlet is contained in a file
c:\development\projects\servtest\WEB_INF\classes\org\fa
boab\servtest\Servtest
which mapped with a <context> tag in the Tomcat
conf\server.xml file:
<!-- Servtest context -->
<Context path="/servtest"
docBase="C:\development\projects\servtest" debug="0"
privileged="true" reloadable="true">
<Logger
er className="org.apache.catalina.logger.FileLogger"
prefix="localhost_servtest_log." suffix=".txt"
timestamp="true"/>
</Context>
My web.xml file contains:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems,
Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>ServTest</servlet-name>
<servlet-class>org.fatboab.servtest.Servtest</servlet-
lass>
</servlet>
</web-app>
Although I have tried putting in <servlet-mapping>
tags, but they didn't seem to work either.
My html file contains:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en">
<head>
<title>Servlet Test</title>
</head>
<body>
<h1>Servlet Test</h1>
<form
action="/servtest/servlet/org.fatboab.servtest.Servtest
method="post">
<table>
<tbody>
<tr>
<td>Name:</td>
<td><input type="text" size="77" name="name"
="name" /></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" size="77" name="email"
"email" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit"
submit" value="Submit" /></td>
</tr>
</tbody>
</table>
</form>
</body>
</html>
The 404 error I get is:
description The requested resource
(/servtest/servlet/org.fatboab.servtest.Servtest) is
not available.
Help!
Cheers,
Bob.Bob,
Here an servlet definition I have defined in my web.xml...just plug in your values.
<servlet>
<servlet-name>AutoUpload</servlet-name>
<servlet-class>com.lendleaserei.webservices.AutoUpload</servlet-class>
<display-name></display-name>
<description></description>
</servlet>
<servlet-mapping>
<url-pattern>/webs</url-pattern>
<servlet-name>com.lendleaserei.webservices.AutoUpload</servlet-name>
</servlet-mapping>
Hope this helps,
Marco -
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
<display-name>Comerica RPM - Relationship Pricing Model</display-name>
<!-- Standard Action Servlet Configuration (with debugging) -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<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>1</load-on-startup>
</servlet>
<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- Struts Tag Library Descriptors -->
<taglib>
<taglib-uri>/WEB-INF/tags/struts-bean</taglib-uri>
<taglib-location>/WEB-INF/tags/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tags/struts-html</taglib-uri>
<taglib-location>/WEB-INF/tags/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tags/struts-logic</taglib-uri>
<taglib-location>/WEB-INF/tags/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tags/struts-nested</taglib-uri>
<taglib-location>/WEB-INF/tags/struts-nested.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tags/struts-tiles</taglib-uri>
<taglib-location>/WEB-INF/tags/struts-tiles.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/tags/displaytag-12</taglib-uri>
<taglib-location>/WEB-INF/tags/displaytag-12.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
<taglib-location>/WEB-INF/tlds/fmt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/xml</taglib-uri>
<taglib-location>/WEB-INF/tlds/x.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
<taglib-location>/WEB-INF/tlds/sql.tld</taglib-location>
</taglib>
</web-app>
Showing red x mark beside file name.
According to tooltip
Invalid content was found starting with element taglib.
one of {"http://java.sun.com/xml/ns/j2ee":description, "http://java.sun.com/xml/ns/j2ee":display name, ...................
What wrong in here?
I just modified
<webapp>
to
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
and added the JSTL taglibs at the end.
thanks.Below is the error.
cvc-complex-type.2.4.a: Invalid content was found starting with element 'taglib'. One of '{"http://java.sun.com/xml/ns/j2ee":description, "http://java.sun.com/xml/ns/j2ee":display-name, "http://java.sun.com/xml/ns/j2ee":icon, "http://java.sun.com/xml/ns/j2ee":distributable, "http://java.sun.com/xml/ns/j2ee":context-param, "http://java.sun.com/xml/ns/j2ee":filter, "http://java.sun.com/xml/ns/j2ee":filter-mapping, "http://java.sun.com/xml/ns/j2ee":listener, "http://java.sun.com/xml/ns/j2ee":servlet, "http://java.sun.com/xml/ns/j2ee":servlet-mapping, "http://java.sun.com/xml/ns/j2ee":session-config, "http://java.sun.com/xml/ns/j2ee":mime-mapping, "http://java.sun.com/xml/ns/j2ee":welcome-file-list, "http://java.sun.com/xml/ns/j2ee":error-page, "http://java.sun.com/xml/ns/j2ee":jsp-config, "http://java.sun.com/xml/ns/j2ee":security-constraint, "http://java.sun.com/xml/ns/j2ee":login-config, "http://java.sun.com/xml/ns/j2ee":security-role, "http://java.sun.com/xml/ns/j2ee":env-entry, "http://java.sun.com/xml/ns/j2ee":ejb-ref, "http://java.sun.com/xml/ns/j2ee":ejb-local-ref, "http://java.sun.com/xml/ns/j2ee":service-ref, "http://java.sun.com/xml/ns/j2ee":resource-ref, "http://java.sun.com/xml/ns/j2ee":resource-env-ref, "http://java.sun.com/xml/ns/j2ee":message-destination-ref, "http://java.sun.com/xml/ns/j2ee":message-destination, "http://java.sun.com/xml/ns/j2ee":locale-encoding-mapping-list}' is expected. [56]
web.xml validation errors detected! -
Hello,
I have a big problem with web.xml.
i can run the servlet demos with the default web.xml, but when i try to user a costum web.xml files, i receive a 404 page not found on a link.
i have some dificulty to post here. but can somebody help my with my web.xml files?
thanks for your help.
have a nice day!Be careful with the place of your files and folders. It's possible that you've just mentioned the cause of your problem.
My web.xml is
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>gco</display-name>
<description>gco webapplicaties</description>
<servlet>
<servlet-name>MopoController</servlet-name>
<servlet-class>org.gertcuppens.controller.MopoController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MopoController</servlet-name>
<url-pattern>/MOPO</url-pattern>
</servlet-mapping>
</web-app>
When I want to call my web application locally, I use the URL http://localhost:8080/gco/MOPO.
The http://localhost:8080 calls Tomcat. With /gco, Tomcat knows it should look for a folder gco inside the webapps folder. This one should contain a WEB-INF/web.xml folder for further instructions.
With /MOPO Tomcat knows, having read the web.xml files of all webapps folders at start, it should look for a servlet with the name MopoController. And this MopoController points to the class org.gertcuppens.controller.MopoController. So, Tomcat knows where to find everything.
Try to see whether your Tomcat can find everything inside the folders using your web.xml file. -
Need help with getResource() problem under weblogic 6.1
Hey all,
I've got a serious problem that I can't figure out. This should be really
simple - but it's alluding me. I have an ear file with a number of servlets
inside it. This ear file also contains a resource that my servlets want to
read from. This resource is located (within the ear file) at:
"/content/structure/a.txt". The file contains raw ascii.
To have my serlvet read from this file, I thought it would be as simple as:
URL content =
servlet.getServletContext().getResource("/content/structure/a.txt");
// pw is an instance of PrintWriter
pw.print(content.getContent());
However, when I execute the above I get the following exception:
java.lang.NullPointerException
at
java.net.URLConnection.stripOffParameters(URLConnection.java:1011)
at java.net.URLConnection.getContentHandler(URLConnection.java:979)
at java.net.URLConnection.getContent(URLConnection.java:581)
OK, so fine - I figure that I'm new to this. The documentation for the URL
class tells me there is another way around this. It says that rather then
calling getContent() directly, I can open a stream on the URL and read from
that, like so:
URL content =
servlet.getServletContext().getResource("/content/structure/scenario2resourc
es.txt");
FileInputStream fis = content.openStream();
but when I do this I get the following different exception:
java.lang.ClassCastException: weblogic.utils.zip.SafeZipFileInputStream^M
at Utility.writeFileToOutput(Utility.java:134)^M
Apparently this thing is trying to return a web-logic-specific stream (which
is incompatible with an FileInputStream) - which I don't want to use or
learn about since I want my stuff to work under other webservers.
Can anyone tell me what I'm doing wrong? This should be simple.
-john
John Hilgedick
WisdomTools, Inc.
[email protected]
Wenjin,
I appreciate your response. I tried treating it as a normal InputStream -
but it didn't make any difference. Here's what I did:
URL content =
servlet.getServletContext().getResource("/content/structure/scenario2resourc
es.txt");
InputStream is = (InputStream)content.getContent();
And here's the exception:
java.lang.NullPointerException^M
at
java.net.URLConnection.stripOffParameters(URLConnection.java:1011)^M
at
java.net.URLConnection.getContentHandler(URLConnection.java:979)^M
at java.net.URLConnection.getContent(URLConnection.java:554)^M
at java.net.URL.getContent(URL.java:807)^M
at Utility.writeFileToOutput(Utility.java:134)^M
You can see that it is definitely breaking somewhere in getContent().
If you have any other ideas, I'd appreciate hearing about them.
-john
----- Original Message -----
From: "Wenjin Zhang" <[email protected]>
Newsgroups: weblogic.developer.interest.servlet
Sent: Wednesday, November 20, 2002 5:03 PM
Subject: Re: Need help with getResource() problem under weblogic 6.1
>
> The "/" in getServletContext().getResource("/content/structure/a.txt")
means the
> web (WAR) application root, not your EAR root.
>
> The ClassCastException is because that content.openStream() is not
FileInputStream
> and has nothing to do with Weblogic. You should treat it as normal
InputStream.
>
>
> "John Hilgedick" <[email protected]> wrote:
> >Hey all,
> >
> >I've got a serious problem that I can't figure out. This should be
really
> >simple - but it's alluding me. I have an ear file with a number of
servlets
> >inside it. This ear file also contains a resource that my servlets want
> >to
> >read from. This resource is located (within the ear file) at:
> >"/content/structure/a.txt". The file contains raw ascii.
> >
> >To have my serlvet read from this file, I thought it would be as simple
> >as:
> >
> >URL content =
> >servlet.getServletContext().getResource("/content/structure/a.txt");
> >// pw is an instance of PrintWriter
> >pw.print(content.getContent());
> >
> >However, when I execute the above I get the following exception:
> >
> >java.lang.NullPointerException
> > at
> >java.net.URLConnection.stripOffParameters(URLConnection.java:1011)
> > at
java.net.URLConnection.getContentHandler(URLConnection.java:979)
> > at java.net.URLConnection.getContent(URLConnection.java:581)
> >
> >OK, so fine - I figure that I'm new to this. The documentation for the
> >URL
> >class tells me there is another way around this. It says that rather
> >then
> >calling getContent() directly, I can open a stream on the URL and read
> >from
> >that, like so:
> >
> >URL content =
>
>servlet.getServletContext().getResource("/content/structure/scenario2resour
c
> >es.txt");
> >FileInputStream fis = content.openStream();
> >
> >but when I do this I get the following different exception:
> >
> >java.lang.ClassCastException: weblogic.utils.zip.SafeZipFileInputStream^M
> > at Utility.writeFileToOutput(Utility.java:134)^M
> >
> >Apparently this thing is trying to return a web-logic-specific stream
> >(which
> >is incompatible with an FileInputStream) - which I don't want to use
> >or
> >learn about since I want my stuff to work under other webservers.
> >
> >Can anyone tell me what I'm doing wrong? This should be simple.
> >
> >-john
> >
> >
> >--
> >John Hilgedick
> >WisdomTools, Inc.
> >[email protected]
> >
> >
>
-
Search Help with Web Dynpro call on another system
Hi all,
I have to create a search help with web dynpro on a field but the database is on another system... How can I do?
Many Thanks in advance...I would use a search help exit. Nothing WDA specific here, as this has been possible long before WDA came around. With a search help exit you define the search help like normal, but instead of database table or view being the source of selection, you have a function module. Within the coding of this function module you can call an RFC to read data from another system or call a web service if you need to bridge over to something that isn't ABAP based.
You can read more about Search Help Exits here:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/cf/21ee52446011d189700000e8322d00/frameset.htm -
Hi all,
I have to create a search help with web dynpro on a field but the database is on another system... How can I do?
Many Thanks in advance...I would use a search help exit. Nothing WDA specific here, as this has been possible long before WDA came around. With a search help exit you define the search help like normal, but instead of database table or view being the source of selection, you have a function module. Within the coding of this function module you can call an RFC to read data from another system or call a web service if you need to bridge over to something that isn't ABAP based.
You can read more about Search Help Exits here:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/cf/21ee52446011d189700000e8322d00/frameset.htm -
Need help with Berkeley XML DB Performance
We need help with maximizing performance of our use of Berkeley XML DB. I am filling most of the 29 part question as listed by Oracle's BDB team.
Berkeley DB XML Performance Questionnaire
1. Describe the Performance area that you are measuring? What is the
current performance? What are your performance goals you hope to
achieve?
We are measuring the performance while loading a document during
web application startup. It is currently taking 10-12 seconds when
only one user is on the system. We are trying to do some testing to
get the load time when several users are on the system.
We would like the load time to be 5 seconds or less.
2. What Berkeley DB XML Version? Any optional configuration flags
specified? Are you running with any special patches? Please specify?
dbxml 2.4.13. No special patches.
3. What Berkeley DB Version? Any optional configuration flags
specified? Are you running with any special patches? Please Specify.
bdb 4.6.21. No special patches.
4. Processor name, speed and chipset?
Intel Xeon CPU 5150 2.66GHz
5. Operating System and Version?
Red Hat Enterprise Linux Relase 4 Update 6
6. Disk Drive Type and speed?
Don't have that information
7. File System Type? (such as EXT2, NTFS, Reiser)
EXT3
8. Physical Memory Available?
4GB
9. Are you using Replication (HA) with Berkeley DB XML? If so, please
describe the network you are using, and the number of Replica’s.
No
10. Are you using a Remote Filesystem (NFS) ? If so, for which
Berkeley DB XML/DB files?
No
11. What type of mutexes do you have configured? Did you specify
–with-mutex=? Specify what you find inn your config.log, search
for db_cv_mutex?
None. Did not specify -with-mutex during bdb compilation
12. Which API are you using (C++, Java, Perl, PHP, Python, other) ?
Which compiler and version?
Java 1.5
13. If you are using an Application Server or Web Server, please
provide the name and version?
Oracle Appication Server 10.1.3.4.0
14. Please provide your exact Environment Configuration Flags (include
anything specified in you DB_CONFIG file)
Default.
15. Please provide your Container Configuration Flags?
final EnvironmentConfig envConf = new EnvironmentConfig();
envConf.setAllowCreate(true); // If the environment does not
// exist, create it.
envConf.setInitializeCache(true); // Turn on the shared memory
// region.
envConf.setInitializeLocking(true); // Turn on the locking subsystem.
envConf.setInitializeLogging(true); // Turn on the logging subsystem.
envConf.setTransactional(true); // Turn on the transactional
// subsystem.
envConf.setLockDetectMode(LockDetectMode.MINWRITE);
envConf.setThreaded(true);
envConf.setErrorStream(System.err);
envConf.setCacheSize(1024*1024*64);
envConf.setMaxLockers(2000);
envConf.setMaxLocks(2000);
envConf.setMaxLockObjects(2000);
envConf.setTxnMaxActive(200);
envConf.setTxnWriteNoSync(true);
envConf.setMaxMutexes(40000);
16. How many XML Containers do you have? For each one please specify:
One.
1. The Container Configuration Flags
XmlContainerConfig xmlContainerConfig = new XmlContainerConfig();
xmlContainerConfig.setTransactional(true);
xmlContainerConfig.setIndexNodes(true);
xmlContainerConfig.setReadUncommitted(true);
2. How many documents?
Everytime the user logs in, the current xml document is loaded from
a oracle database table and put it in the Berkeley XML DB.
The documents get deleted from XML DB when the Oracle application
server container is stopped.
The number of documents should start with zero initially and it
will grow with every login.
3. What type (node or wholedoc)?
Node
4. Please indicate the minimum, maximum and average size of
documents?
The minimum is about 2MB and the maximum could 20MB. The average
mostly about 5MB.
5. Are you using document data? If so please describe how?
We are using document data only to save changes made
to the application data in a web application. The final save goes
to the relational database. Berkeley XML DB is just used to store
temporary data since going to the relational database for each change
will cause severe performance issues.
17. Please describe the shape of one of your typical documents? Please
do this by sending us a skeleton XML document.
Due to the sensitive nature of the data, I can provide XML schema instead.
18. What is the rate of document insertion/update required or
expected? Are you doing partial node updates (via XmlModify) or
replacing the document?
The document is inserted during user login. Any change made to the application
data grid or other data components gets saved in Berkeley DB. We also have
an automatic save every two minutes. The final save from the application
gets saved in a relational database.
19. What is the query rate required/expected?
Users will not be entering data rapidly. There will be lot of think time
before the users enter/modify data in the web application. This is a pilot
project but when we go live with this application, we will expect 25 users
at the same time.
20. XQuery -- supply some sample queries
1. Please provide the Query Plan
2. Are you using DBXML_INDEX_NODES?
Yes.
3. Display the indices you have defined for the specific query.
XmlIndexSpecification spec = container.getIndexSpecification();
// ids
spec.addIndex("", "id", XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
spec.addIndex("", "idref", XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
// index to cover AttributeValue/Description
spec.addIndex("", "Description", XmlIndexSpecification.PATH_EDGE | XmlIndexSpecification.NODE_ELEMENT | XmlIndexSpecification.KEY_SUBSTRING, XmlValue.STRING);
// cover AttributeValue/@value
spec.addIndex("", "value", XmlIndexSpecification.PATH_EDGE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
// item attribute values
spec.addIndex("", "type", XmlIndexSpecification.PATH_EDGE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
// default index
spec.addDefaultIndex(XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ELEMENT | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
spec.addDefaultIndex(XmlIndexSpecification.PATH_NODE | XmlIndexSpecification.NODE_ATTRIBUTE | XmlIndexSpecification.KEY_EQUALITY, XmlValue.STRING);
// save the spec to the container
XmlUpdateContext uc = xmlManager.createUpdateContext();
container.setIndexSpecification(spec, uc);
4. If this is a large query, please consider sending a smaller
query (and query plan) that demonstrates the problem.
21. Are you running with Transactions? If so please provide any
transactions flags you specify with any API calls.
Yes. READ_UNCOMMITED in some and READ_COMMITTED in other transactions.
22. If your application is transactional, are your log files stored on
the same disk as your containers/databases?
Yes.
23. Do you use AUTO_COMMIT?
No.
24. Please list any non-transactional operations performed?
No.
25. How many threads of control are running? How many threads in read
only mode? How many threads are updating?
We use Berkeley XML DB within the context of a struts web application.
Each user logged into the web application will be running a bdb transactoin
within the context of a struts action thread.
26. Please include a paragraph describing the performance measurements
you have made. Please specifically list any Berkeley DB operations
where the performance is currently insufficient.
We are clocking 10-12 seconds of loading a document from dbd when
five users are on the system.
getContainer().getDocument(documentName);
27. What performance level do you hope to achieve?
We would like to get less than 5 seconds when 25 users are on the system.
28. Please send us the output of the following db_stat utility commands
after your application has been running under "normal" load for some
period of time:
% db_stat -h database environment -c
% db_stat -h database environment -l
% db_stat -h database environment -m
% db_stat -h database environment -r
% db_stat -h database environment -t
(These commands require the db_stat utility access a shared database
environment. If your application has a private environment, please
remove the DB_PRIVATE flag used when the environment is created, so
you can obtain these measurements. If removing the DB_PRIVATE flag
is not possible, let us know and we can discuss alternatives with
you.)
If your application has periods of "good" and "bad" performance,
please run the above list of commands several times, during both
good and bad periods, and additionally specify the -Z flags (so
the output of each command isn't cumulative).
When possible, please run basic system performance reporting tools
during the time you are measuring the application's performance.
For example, on UNIX systems, the vmstat and iostat utilities are
good choices.
Will give this information soon.
29. Are there any other significant applications running on this
system? Are you using Berkeley DB outside of Berkeley DB XML?
Please describe the application?
No to the first two questions.
The web application is an online review of test questions. The users
login and then review the items one by one. The relational database
holds the data in xml. During application load, the application
retrieves the xml and then saves it to bdb. While the user
is making changes to the data in the application, it writes those
changes to bdb. Finally when the user hits the SAVE button, the data
gets saved to the relational database. We also have an automatic save
every two minues, which saves bdb xml data and saves it to relational
database.
Thanks,
Madhav
[email protected]Could it be that you simply do not have set up indexes to support your query? If so, you could do some basic testing using the dbxml shell:
milu@colinux:~/xpg > dbxml -h ~/dbenv
Joined existing environment
dbxml> setverbose 7 2
dbxml> open tv.dbxml
dbxml> listIndexes
dbxml> query { collection()[//@date-tip]/*[@chID = ('ard','zdf')] (: example :) }
dbxml> queryplan { collection()[//@date-tip]/*[@chID = ('ard','zdf')] (: example :) }Verbosity will make the engine display some (rather cryptic) information on index usage. I can't remember where the output is explained; my feeling is that "V(...)" means the index is being used (which is good), but that observation may not be accurate. Note that some details in the setVerbose command could differ, as I'm using 2.4.16 while you're using 2.4.13.
Also, take a look at the query plan. You can post it here and some people will be able to diagnose it.
Michael Ludwig -
Please help with web services (JSR 172)
Hello!
I'm in need of some help. I've only worked with web services some few weeks. I have two web services that I want to access from J2ME.
Both works nice in regular Java (J2SE). I use axis so with the help of WSDL2Java I got a working client.
One of them has four operations
public boolean tryToLoginUser( String username, String password ) {}
public boolean tryToLogOffUser( String username, String password ){}
public boolean createUserAccount( String username, String password ){ }
public boolean removeUserAccount( String username, String password ){ } The problem is when I want to use Sun's Wireless Toolkit 2.2 and create stubs that way with the Stub Generator. It complains with this
warning: Operation tryToLoginUser is of the wrong encoding SOAP style/use (rpc/encoded). Document/literal only. Skipping generation of operation.
warning: Operation tryToLogOffUser is of the wrong encoding SOAP style/use (rpc/encoded). Document/literal only. Skipping generation of operation.
warning: Operation createUserAccount is of the wrong encoding SOAP style/use (rpc/encoded). Document/literal only. Skipping generation of operation.
warning: Operation removeUserAccount is of the wrong encoding SOAP style/use (rpc/encoded). Document/literal only. Skipping generation of operation.What I can tell is I need to put this in my axis deployment descriptor
<service name="UserWebService" provider="java:RPC" style="document" use="literal">instead of this:
<service name="UserWebService" provider="java:RPC">This wont work. It don't work with HTTP GET I get this error
<?xml version="1.0" encoding="UTF-8" ?>
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <soapenv:Body>
- <soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.</faultstring>
- <detail>
<ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">slukare</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>I doesn�t work with WSDL2Java and when I run Sun's Wireless Toolkit 2.2 to generate stub it complains with
warning: ignoring operation "tryToLoginUser": more than one part in input message
warning: ignoring operation "tryToLogOffUser": more than one part in input message
warning: ignoring operation "createUserAccount": more than one part in input message
warning: ignoring operation "removeUserAccount": more than one part in input message
warning: Port "UserWebService" does not contain any usable operationsDoes this mean I can only use one parameter for input in an operation when I use style="document" use="literal" ??
I understood it that way, so I created a new web service that takes username and password in one String.
The new web service has four operations
public boolean tryToLoginUser( String usernameAndPassword ) {}
public boolean tryToLogOffUser( String usernameAndPassword ){}
public boolean createUserAccount( String usernameAndPassword ){ }
public boolean removeUserAccount( String usernameAndPassword ){ }The problem is that I get this error when running HTTP GET.
<?xml version="1.0" encoding="UTF-8" ?>
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <soapenv:Body>
- <soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.</faultstring>
- <detail>
<ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">slukare</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>If I get a WSDL2Java client it works (!) if I manually changes the parameter names. I have four operations which all takes
String usernameAndPassword
in one String since I can only use one parameter with style="document" use="literal"
The WSDL2Java automatically set the parameter names to
usernameAndPassword
usernameAndPassword1
usernameAndPassword2
usernameAndPassword3
for the different operations. If I manually changes them to all have the name
usernameAndPassword
it works. Why doesn�t it work without manual changes? I haven�t tested the code from Sun�s Wireless Toolkit 2.2 Stub Generator yet, but that at least doesn�t give any errors .
My other web service doesn�t work either if I set style="document" use="literal".
This web service returns my own classes I have written. It works as I said previously in J2SE with WSDL2Java, but not with style="document" use="literal�. When I set this my byte[] which is returned is null when using the client from WSDL2Java, this wasn�t the case without style="document" use="literal�.
I also get an error in Sun�s Wireless Toolkit 2.2 that byte[] is not recoigniced. This wasn�t the case with axis WSDL2Java.
If I put this inside the axis deployment descriptor
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service xmlns:j2melab2="urn:businessobject.j2melab2"
name="RecipeWebService" provider="java:RPC" style="document" use="literal">
<parameter name="scope" value="session"/>
<parameter name="className" value="j2melab2.webservices.RecipeWebService"/>
<parameter name="allowedMethods" value="*"/>
<typeMapping qname="j2melab2:ArrayOfString"
type="java:java.lang.String[]"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
<beanMapping qname="j2melab2:Recipe" languageSpecificType="java:j2melab2.businessobject.Recipe"/>
<beanMapping qname="j2melab2:Ingredient" languageSpecificType="java:j2melab2.businessobject.Ingredient"/>
<typeMapping qname="j2melab2:ArrayofIngredient"
type="java:j2melab2.businessobject.Ingredient[]"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
<typeMapping qname="j2melab2:ArrayOfByte"
type="byte[]"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
</service>
</deployment>instead of this
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service xmlns:j2melab2="urn:businessobject.j2melab2"
name="RecipeWebService" provider="java:RPC">
<parameter name="scope" value="session"/>
<parameter name="className" value="j2melab2.webservices.RecipeWebService"/>
<parameter name="allowedMethods" value="*"/>
<typeMapping qname="j2melab2:ArrayOfString"
type="java:java.lang.String[]"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
<beanMapping qname="j2melab2:Recipe" languageSpecificType="java:j2melab2.businessobject.Recipe"/>
<beanMapping qname="j2melab2:Ingredient" languageSpecificType="java:j2melab2.businessobject.Ingredient"/>
<typeMapping qname="j2melab2:ArrayofIngredient"
type="java:j2melab2.businessobject.Ingredient[]"
serializer="org.apache.axis.encoding.ser.ArraySerializerFactory"
deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding"/>
</service>
</deployment>axis WSDL2Java won�t work anymore. And Sun�s Wireless Toolkit doesn�t work either with this. How can I get this to work with Sun�s Wireless Toolkit 2.2?
So my questions are:
Do I really need style=�document� use=�literal� for J2ME?
Can I only have one parameter as input when I use style=�document� use=�literal� ?
Why do I need to manally change the parameter names?
How can I make Sun�s Wireless Toolkit 2.2 understand byte[] ?
Many thanks for help :) (I have to present a solution in 1 � week to my J2ME teacher L).hi,
i was wandering if you manage to successfully generate the stubs through the wireless toolkit at the end? i am currently having similar problem (i.e., trying to generate stub files based on wsdl from axis)? it seems that the WTK can only handle document/literal format, and so i change the wsdl to that. however, now it complains that it can't handle more than one input part in the message, (which is similar to the problem you had). so did you manage to find a solution to that, or J2ME simply does not support more than one arguement as the input?
thanks in advance,
lee -
Taglib tag doesn't work with web.xml 2.4 ?
That is, I switched to the 2.4 version of web.xml and now none of the taglib elements I have in there work.
I get the following excpetion
org.apache.jasper.JasperException: File "/tags/struts-html" not found
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.jav a:105)
I've been surfing a good portion of the day looking for some documentation on this but to no avail. I did find that I should wrap the taglib elements in a jsp-info. I'm runing tomcat 5.0.19.
In any event here is my web.xml:
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd"
version="2.4">
<display-name>Struts Examples Application</display-name>
<!-- Standard Action Servlet Configuration (with debugging) -->
<servlet>
<servlet-name>InitServlet</servlet-name>
<servlet-class>com.jacent.admin.servlet.init.InitServlet</servlet-clas s>
<init-param>
<param-name>log4j</param-name>
<param-value>/WEB-INF/log4j.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class&g t;
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<!-- module configurations -->
<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>
<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- Struts Tag Library Descriptors -->
<jsp-config>
<taglib>
<taglib-uri>/tags/struts-bean</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-html</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-logic</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-nested</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-tiles</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/datetime</taglib-uri>
<taglib-location>/WEB-INF/datetime.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/tabs-taglib</taglib-uri>
<taglib-location>/WEB-INF/tabs-taglib.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/admin-widgets</taglib-uri>
<taglib-location>/WEB-INF/admin-widgets.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>http://java.sun.com/jsp/jstl/core</taglib-location> ;
</taglib>
</jsp-config>
</web-app>
In addition Eclipse is complaining about web-app element not able to be found.
Thanks for anyone's help!
John#1 programmers excuse: It works for me. You must be doing something wrong.
Finding out what is the trick.
I have Tomcat 5.0.28, but I don't think it would make THAT much difference.
What version of Java are you running?
You shouldn't need the entry for the JSTL library c. That works without an entry in web.xml, provided you use the correct URI.
First step: make a test page that only uses that one taglib - eg an html:base tag.
Confirm that it breaks with the current setup.
Backup web.xml, and start it from scratch with an absolute minimal one - only import the struts-html library.
Does that work?
Slowly copy and paste in the different bits of web.xml until you find what breaks it.
Hope this helps,
evnafets -
Hi ,
Earlier my application was running fine on JBOSS 5.0 .
In that web.xml was like
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_4.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_4.xsd"
id="WebApp_ID" version="2.4">
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Timer Details -->
<servlet>
<servlet-name>perfMonCollector</servlet-name>
<servlet-class>com.dbag.optimise.performancemonitor.timer.PerfMonitorCollector</servlet-class>
<load-on-startup>4</load-on-startup>
<init-param>
<param-name>cronExpr</param-name>
<param-value>0 0 0 */1 * ?</param-value>
<!--<param-value>0 */10 * * * ?</param-value> -->
</init-param>
</servlet>
<servlet>
<servlet-name>TransAnalysisCollector</servlet-name>
<servlet-class>com.dbag.optimise.performancemonitor.timer.TransAnalysisCollector</servlet-class>
<load-on-startup>3</load-on-startup>
<init-param>
<param-name>cronExprTransAnalysis</param-name>
<param-value>*/30 * * * * ?</param-value>
</init-param>
</servlet>
<!-- Timer Details -->
<!-- PerfMonPoints Cache Generation on Server Startup -->
<servlet>
<servlet-name>perfMonGenerator</servlet-name>
<servlet-class>com.dbag.optimise.performancemonitor.timer.PerfMonPointsGenerator</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<!-- PerfMonPoints Cache Generation on Server Startup -->
<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>jsp/index.jsp</welcome-file>
</welcome-file-list>
But now i have deployed my application on JBOSS 5.1 GA version.
Now its giving exception.
Caused by:
org.xml.sax.SAXException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'. One of '{"http://java.sun.com/xml/ns/javaee":run-as, "http://java.sun.com/xml/ns/javaee":security-role-ref}' is expected. @ vfsfile:/local/dubeavi/jboss-5.1.0.GA/server/default/deploy/PerformanceMonitoringISE-1.0/WEB-INF/web.xml[28,15]
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$MetaDataErrorHandler.error(SaxJBossXBParser.java:426)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:199)
... 41 moreMy new web.xml is like..
<web-app
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID"
version="2.5">
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet> -
Help on web.xml file, what if the parameters contains key words ?
Hi:
I am just wondering what should I do if I want to include key words suchs
as <param> in web.xml file for a servlet config.
Example:
<servlet>
<servlet-name>testServlet</servlet-name>
<parameter>
<param-name>some name</param-name>
<param-value>some value</param-value>
</parameter>
</servlet>
What should I do if I want to repleace 'some value' with '</param-value>some
value' and still to prevent the engine to terminate parsing the param-value
at the fake ending? Is there a standard way in XML to distanguish that?
(in URL format it can be replaced %xx for some chars).
ie,
<param-value> </param-value>some value</param-value>
where the second </param-value> is the real ending.
Thank you!
GangHi!
You can use "& lt ;" and "& gt ;" xml entities for that. Or wrap text element in <![CDATA[...]]> section.
Regards,
Ignat. -
Help with web form script. PHP, CGI, Perl???
anyone willing to help with a web form script? I have a form built, but cant seem to figure out the scripting! Should I be using Perl, CGI, PHP... What do I need to enable? I am a complete novice when it comes to scripts. Looking for a little friendly help.
Here is a simple bit of PHP to stick in the page your form posts to. You would need to edit the first three variables to your liking, and add the html you want to serve afterwards:
<pre>
<?php
$emailFrom = '[email protected]';
$emailTo = '[email protected]';
$emailSubject = 'Subject';
$date = date('l, \t\h\e dS \o\f F, Y \a\t g:i A');
$browser = $HTTPSERVER_VARS['HTTP_USERAGENT'];
$hostname = $HTTPSERVER_VARS['REMOTEADDR'];
$message = "$date\n\nAddress: $hostname\nBrowser: $browser\n\n";
foreach ($_POST as $key => $value) {
$message .= $key . ": " . $value . "\n";
$mailResult = mail($emailTo,$emailSubject,$message,"From: $emailFrom");
?>
</pre>
This script will grab the server's date and the submitter's address and browser type. It will then list the name and value of each form field you have put on your form.
Also, this script expects your form method="post".
Lastly, you can offer alternate text later on in your html page based on the success of the above script with a snippet like this:
<pre><?php
if ($mailResult) {
echo "Your comments have been received thank you.";
} else {
echo "There was an error. Please try again or contact us using an alternate method.";
?></pre> -
Help! web.xml security without using WAR files
I'm currently using the RDBMSRealm and URL ACL security for my app. I would like to use the web.xml descriptor for security so that I can specify login pages and such. We currently are not using WAR files. I've been having alot of trouble setting this up. Is there a way to use the RDBMS realm along with the web.xml security? It looks like it should work, but I can't seem to get it to function. How do I specify the regular document root as a webapp? I'm currently running WLS 5.1 with SP4. Thanks.
The RDBMSRealm is just the authentication mechanism underneath WLS versus the
web.xml of the WebApplication which describes all the access control for that WebApp.
the later being scoped only to that WebApp.
you don't need to deploy in a war file, you can expand the archive into an identical
directory structure and then just point us towards the top level of that structure.
see: http://www.weblogic.com/docs51/classdocs/webappguide.html
.paul
chris wrote:
I'm currently using the RDBMSRealm and URL ACL security for my app. I would like to use the web.xml descriptor for security so that I can specify login pages and such. We currently are not using WAR files. I've been having alot of trouble setting this up. Is there a way to use the RDBMS realm along with the web.xml security? It looks like it should work, but I can't seem to get it to function. How do I specify the regular document root as a webapp? I'm currently running WLS 5.1 with SP4. Thanks. -
Help: ServletRequestListener & web.xml ?????
salamat,
i wrote a sample that uses a ServletRequestListener .The code is fine , when i try to statrt my application it gives me a HTTP status 404 The requested resource (/index.jsp) is not available.......
when i remove my listener decleration from the web.xml it works fine but without the listener class (ServletRequestListener). my web.xml is
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app >
<listener>
<listener-class>listener.uu</listener-class>
</listener>
</web-app>
and the class that implements the ServletRequestListener interface is
package listener;
import javax.servlet.*;
public class uu implements ServletRequestListener {
private static long reqCount=0;
public uu(){}
public void requestInitialized(ServletRequestEvent sre){
System.out.println("this is count"+ reqCount++);
public void requestDestroyed(ServletRequestEvent sre){
}//requestDestroyed
}// ReqListener
may be it is something with xml DTD ?? 2.3 or 2.4 ?? should i declare any thing else in my web.xml
im working on SUN ONE 6 studio, j2sdk1.4.1_06You dtd should definitly be 2.4 since your using the 2.4 specification. Also, does SUN ONE 6 studio support the 2.4 spec (I don't know because I don't use the product)
Maybe you are looking for
-
How to install Intervideo 5 on a Qosmio G30
Hi, I have lost my recovery disc and now all my drivers have gone and i was wondering if there is anyway to get intervideo back without paying for it. Someone help please, will be very grateful!
-
Are there static methods in TOOL
Do static or class methods exist in TOOL? If they do, I would appreciate a pointer to the documentation. If they don't exist, what is best practice for creating utility or helper methods for things like string operations, getting random numbers withi
-
Problem retrieving BLOB column
I'm using PB 12.5.1 / DB2 Version 10 / ODBC driver When executing this embedded SQL Statement in the application, I'm getting a popup window asking me to "Select Data Source" SELECTBLOB BLOB_OBJECT INTO :LB_TEST FROM BLOB_TABLE WHERE BLOB_NAME = 'BAN
-
Hello, here my problem: I have a region(SQL_Report) called "Search". There I have a search-function. On this region I have two Buttons. One calleed Search and one called Reset. If I search after a word and click on the Search Button I get a result ta
-
Just signed up for Ps & Lr cc Mac OSX 10.6.8 Lightroom won't install.
I was able to download and install Ps cc, but Lightroom appears to download, but fails to install. This is the error I am getting. I have tried several times even after a reboot, it fails. Exit Code: 7 Please see specific errors below for troubleshoo