Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

scripting-invalid question

 
jack li
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I configured web.xml as below
<?xml
...
version="2.4">

...
<jsp-property-group>
<url-pattern>*</url-pattern>
<scripting-invalid>true</scripting-invalid>
</jsp-property-group>
...

then I used scriptlet and declaration in my jsp, shouldn't it be any error when I query this jsp? but seems the jsp file was successfully compiled and displayed, as if the scripting-invalid was configured as false.
I'm using Tomcat 5 and JRE 1.4

Did I miss anything
Thanks
 
Ali Gohar
Ranch Hand
Posts: 572
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

<url-pattern>*</url-pattern>


This url pattern is not a valid one, use "*.jsp" instead of "*"
 
jack li
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, but still the same. any other clue?
 
Deepinder S Narang
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
even i had faced the same problem ........ inspite of the syntax being correct
 
Ali Gohar
Ranch Hand
Posts: 572
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using servlet2.4 specs?

your web.xml file's web-app element should look like this
 
Deepinder S Narang
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thxs !

it works after mentioning the veriosn no. .......
this verion realted info. wasnt available in HFSJ
 
jack li
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For me, it is already version 2.4, will it be a tomcat issue?
Thanks
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is already version 2.4

Can you please post your <web-app> tag ?
 
jack li
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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" >
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure you don't have a servlet-mapping matching the requested URL.
If a resource matches a URL pattern in both a <servlet-mapping> and a <jsp-property-group>, the pattern that is most specific applies.
 
jack li
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I paste all the things here
web.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<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" >

<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<scripting-invalid>true</scripting-invalid>
</jsp-property-group>

</web-app>

Jsp:
<% out.println("Hello !"); %>

Thanks
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the <jsp-property-group> tag must be in a <jsp-config> tag

 
jack li
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's the point
Thanks a lot
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic