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 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Scripting Invalid" Watch "Scripting Invalid" New topic
Author

Scripting Invalid

Chetan Raju
Ranch Hand

Joined: Aug 02, 2006
Posts: 109
Hello Ranchers,

I want to disable scripting in JSP file. The JSP 2.0 specs define a way to do so.

I have entered the following in the web.xml of my application

<

However, the scripts are not being ignored in my JSP's. They are working as normal. Can anyone suggest what might be wrong ?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Maybe your previous pages are still in the cache. If you're using Tomcat, go to "work\Catalina\localhost" and remove everything under "org\apache\jsp" of your application.


[My Blog]
All roads lead to JavaRanch
Chetan Raju
Ranch Hand

Joined: Aug 02, 2006
Posts: 109
Hi,

I have tried clearing the cache under the work directory. But still the problem persists. Could this be something else ?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Oops, the tag is <scripting-invalid>, not <scriptlet-invalid>
Chetan Raju
Ranch Hand

Joined: Aug 02, 2006
Posts: 109
The JSP is called index.jsp. It is in the welcome file list



The URL I am using to access the JSP is

and


I tried both.. but not the desired or expected results
Chetan Raju
Ranch Hand

Joined: Aug 02, 2006
Posts: 109
... and FYI, I am using Tomcat 5.5.23 with JDK 1.4 compatibility package.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

As I pointed out in a previous post, try <scripting-invalid> instead of <scriptlet-invalid>
Chetan Raju
Ranch Hand

Joined: Aug 02, 2006
Posts: 109
Well I thought <scripting-invalid> should have solved the problem but to my surprise, the problem still persists. I cleared the cache once again but the same results..
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

And you have restarted the container ?
Chetan Raju
Ranch Hand

Joined: Aug 02, 2006
Posts: 109
Yea.. I did that.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Did you check the logs ?

One more thing. Did you configure the web-app tag properly ?

<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" >
[ April 25, 2007: Message edited by: Satou kurinosuke ]
Chetan Raju
Ranch Hand

Joined: Aug 02, 2006
Posts: 109
Finally its working!! I updated the web-app tag to the one you pasted and restarted the container. Thank you very much.

But what exactly does the attributes in the <web-app> mean ?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

It means that you are using version 2.4 of the servlets specifications.
The jsp-config tag was introduced from this version.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scripting Invalid