• Post Reply Bookmark Topic Watch Topic
  • New Topic

scriptlet invalid issue  RSS feed

 
Yogendra Joshi
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello ranchers ,

I have an question here that when we turn scripting-invalid in web.xml it does not allow any scriptlets or expressions not even jsp:declaration and all.. Thats its purpose. So fine till now.

Now the question is , i want to use JSTL taglib what is the way of declaring the taglib ? because yesterday i used <jsp:directive> and it said Scriptlets are disallowed here.

Thanks in Advance.
Yogendra N Joshi.
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

To use JSTL tags, include the jstl and standard jar file in the the lib subdirectory of WEB-INF, then in the you JSP file you have to say :



Then start using the tags like, <c:if ...> , <c:forEach ...> ...

Best of luck ...
 
Yogendra Joshi
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I appreciate your help however i guess you have not understood my question. I already know how to use JSTL.

My question is , I have disabled scripting for all the jsp's of the application by saying that i mean this :



This is the code which i have added to the deployment descriptor (web.xml) file. When this code is written , none of the jsp files which has <%%> or <%=%>, or <%!%> or <jsp:directive> would work and thats where my worry starts.

Now i am locked , i have no option of using <%@taglib uri....%> because it would throw exception saying directives are disabled in this application.

now , the help which i want is :

How do i still use c tag and other tags of JSTL without using <%@taglib%> or <jsp:directive>.

hope i have explained my problem in much detail now.

Expecting a reply which would help me work the above scenario out.

Thanks in Advance ,

Yogendra.N.Joshi.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Disabling scripting should not preclude the use of tags or directives. There must be something else at work here.
 
Yogendra Joshi
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Bear ,

Do you mean to say that there might be some other scripting code in here in the code ?

My code is very simple...

I import the required taglib using below line



and then use the c tag to redirect the request to some other jsp.

<c:redirect url="/TestApp/yogendra.jsp"/>

No scripting in here except the above taglib directive. What do you and ben suggest ?

Thanks in Advance.
Yogendra N Joshi.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What container (make and version) are you using?
 
Yogendra Joshi
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ben ,

Thanks for the reply..

I am using Tomcat 5.0.28

Thanks again in advance.

Yogendra
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just tried in Tomcat 5.0.28 and it worked.

Do you have any scriptlets in the page to which your forwarding?
TestApp/yogendra.jsp?

Maybe it's blowing up there.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!