File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes scripting-invalid question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "scripting-invalid question" Watch "scripting-invalid question" New topic
Author

scripting-invalid question

jack li
Greenhorn

Joined: Jul 04, 2005
Posts: 8
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

Joined: Mar 18, 2004
Posts: 572

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


This url pattern is not a valid one, use "*.jsp" instead of "*"
jack li
Greenhorn

Joined: Jul 04, 2005
Posts: 8
Thanks, but still the same. any other clue?
Deepinder S Narang
Greenhorn

Joined: Sep 05, 2006
Posts: 21
even i had faced the same problem ........ inspite of the syntax being correct
Ali Gohar
Ranch Hand

Joined: Mar 18, 2004
Posts: 572
Are you using servlet2.4 specs?

your web.xml file's web-app element should look like this
Deepinder S Narang
Greenhorn

Joined: Sep 05, 2006
Posts: 21
thxs !

it works after mentioning the veriosn no. .......
this verion realted info. wasnt available in HFSJ
jack li
Greenhorn

Joined: Jul 04, 2005
Posts: 8
For me, it is already version 2.4, will it be a tomcat issue?
Thanks
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

it is already version 2.4

Can you please post your <web-app> tag ?


[My Blog]
All roads lead to JavaRanch
jack li
Greenhorn

Joined: Jul 04, 2005
Posts: 8
<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

Joined: Nov 24, 2005
Posts: 14687
    
  16

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

Joined: Jul 04, 2005
Posts: 8
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

Joined: Nov 24, 2005
Posts: 14687
    
  16

the <jsp-property-group> tag must be in a <jsp-config> tag

jack li
Greenhorn

Joined: Jul 04, 2005
Posts: 8
That's the point
Thanks a lot
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: scripting-invalid question
 
Similar Threads
To make script invalid
scripting-invalid tag in web.xml
Scripting Invalid Tag - tomcat 5.5
Scripting Invalid
how to contrain a JSP page to be scriptless?