Re: What is the difference between ${param.P} and <%= request.getParameter("P") %>?

2010-06-11 Thread Otmar Manuela
Thanks for the replies.  I figured out what was causing the problem.  I 
was using parameters with dashes in it and that was causing this 
problem.  Since I only tested with different parameters with dashes in 
them, I assume it was happening with all parameters.  My bad!


So the problem would not happen with ${param.P}, but only with 
${param.my-code}.  I guess with parameters with dashes in it, it treats 
it as a calculation and therefore returns a 0.


Regarding the javascript attack in the code sample, you are probably 
right.  I guess a  escaping the XML characters will probably help 
a lot already, but it does require more thought.


Otmar


On 6/9/2010 4:09 AM, Pid wrote:

On 08/06/2010 19:06, Otmar Manuela wrote:
   

Hi,

I have a contact page, which contains a struts form.  However, on that
page, when trying to read the URL parameters, I get a zero instead of
the parameter value, unless I use<%= request.getParameter() %>.

Example:

URL loading the contact form page:
http://www.somedomain.com/contact.do?itemCode=ABC

Contact Form Page:
..
Please send me info regarding ${param.itemCode}



Submit

.


The paragraph in the Contact Form page above shows "Please send me info
regarding 0".  If I change ${param.itemCode} with<%=
request.getParameter("itemCode") %>, I get "Please send me info
regarding ABC", which is what I want to show.
This is the first time I encountered this issue.  Normally both would
return the same thing.

Any idea what is happening?  I'm trying to avoid the "<%=   %>" syntax
as much as possible.
 

Hard to know which JSP version you're using without knowing which Tomcat
version, and which version number you have in your web.xml.

It's usually a good idea to tell us everything about your environment,
including exact Tomcat, OS, JVM and any relevant library versions.

If you want to use EL scripting then you may also need to check it's
enabled by default (jsp-config section of web.xml if memory servers)


p


P.S. Also, the above code is probably horribly exposed to javascript
attacks, you should not display raw parameter information anywhere in
your HTML





   

Thanks,

Otmar

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

 


   


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



What is the difference between ${param.P} and <%= request.getParameter("P") %>?

2010-06-08 Thread Otmar Manuela

Hi,

I have a contact page, which contains a struts form.  However, on that 
page, when trying to read the URL parameters, I get a zero instead of 
the parameter value, unless I use <%= request.getParameter() %>.


Example:

URL loading the contact form page:   
http://www.somedomain.com/contact.do?itemCode=ABC


Contact Form Page:
..
Please send me info regarding ${param.itemCode}



Submit

.


The paragraph in the Contact Form page above shows "Please send me info 
regarding 0".  If I change ${param.itemCode} with <%= 
request.getParameter("itemCode") %>, I get "Please send me info 
regarding ABC", which is what I want to show.
This is the first time I encountered this issue.  Normally both would 
return the same thing.


Any idea what is happening?  I'm trying to avoid the "<%=   %>" syntax 
as much as possible.


Thanks,

Otmar

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Issues with ROOT.xml in Tomcat 6.0.24

2010-03-01 Thread Otmar Manuela

On 3/1/2010 11:05 AM, Caldarale, Charles R wrote:

From: Otmar Manuela [mailto:ot...@caribmedia.com]
Subject: Issues with ROOT.xml in Tomcat 6.0.24

I have a tomcat instance of Tomcat 6.0.24 running, but whenever I
deploy my application in the root context, I can only start it once.
If I restart, I get a 404 error "The requested resource is unavailable".
 

What's in the Tomcat logs?
   
This is the output of catalina.out when the instance starts and ROOT.xml 
is not deleted beforehand:


Mar 1, 2010 8:52:36 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal 
performance in production environments was not found
 on the java.library.path: 
/usr/local/jre1.6.0_18/lib/i386/server:/usr/local/jre1.6.0_18/lib/i386:/usr/local/jre1.6.0_18/.

./lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
Mar 1, 2010 8:52:37 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8110
Mar 1, 2010 8:52:37 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1274 ms
Mar 1, 2010 8:52:37 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 1, 2010 8:52:37 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.24
Mar 1, 2010 8:52:37 AM org.apache.catalina.startup.HostConfig 
deployDescriptor

INFO: Deploying configuration descriptor host-manager.xml
Mar 1, 2010 8:52:37 AM org.apache.catalina.startup.HostConfig 
deployDescriptor

INFO: Deploying configuration descriptor manager.xml
Mar 1, 2010 8:52:37 AM org.apache.catalina.startup.HostConfig 
deployDescriptor

INFO: Deploying configuration descriptor ROOT.xml
Mar 1, 2010 8:52:38 AM org.apache.catalina.startup.HostConfig 
deployDirectory

INFO: Deploying web application directory examples
Mar 1, 2010 8:52:38 AM org.apache.catalina.startup.HostConfig 
deployDirectory

INFO: Deploying web application directory docs
Mar 1, 2010 8:52:38 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8110
Mar 1, 2010 8:52:38 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8039
Mar 1, 2010 8:52:38 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/27  config=null
Mar 1, 2010 8:52:38 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1573 ms

Normally, tomcat takes 6 seconds to start up successfully with the 
application, but here it starts up in just 1.5 seconds.



What exactly is the procedure you're following to do a "restart"?

   
The "restart" is nothing more than manually running a shutdown script 
(which sets the environment variables and then runs 'catalina.sh stop'), 
wait to make sure the process is gone, then manually run a startup 
script (which sets the environment variables and then runs 'catalina.sh 
start').



Tomcat 6.0.19 and above always copy the  element to 
conf/Catalina/[host]/[appName].xml.

   

Thanks for this info.  Good to know this is normal.

Otmar

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Issues with ROOT.xml in Tomcat 6.0.24

2010-03-01 Thread Otmar Manuela

Hi,

I have a tomcat instance of Tomcat 6.0.24 running, but whenever I deploy 
my application in the root context, I can only start it once.  If  I 
restart, I get a 404 error "The requested resource is unavailable".  I 
noticed that if I remove the 
/conf/Catalina/localhost/ROOT.xml and then restart, it 
restarts fine, but it adds ROOT.xml back into this directory.


I know I can create a startup script that removes ROOT.xml before 
starting the tomcat instance (and I believe I will do this for now), but 
I wonder if this is a bug or if there is something I need to configure.  
I have a few Tomcat 5.5 instances and one Tomcat 6.0.18 instance running 
the same application without having this issue on other servers.  In 
fact, I see that on the other servers, the 
/conf/Catalina/localhost/ROOT.xml is not even created 
when the server starts.   I also have another server running Tomcat 
6.0.24 with the same application, but using a context other than ROOT 
and this also runs fine, so to me the issue seems to be related to 
Tomcat 6.0.24 and using the ROOT context.


Any ideas what could be causing this?

Otmar

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org