Pessoal, alguém sabe qual eh o comando colocado no web.xml q faz com que naum seja executado scriplets…
Valeu…
Web.xml
18 Respostas
Como assim? :roll:
Assim:
Tem uma maneira de não permitir q scriptlets em páginas JSP sejam executados…
Então caso uma página tenho scriptlet ele naum vai ser executado…
Não tem como barrar os scriptlets do JSP.
Aliás, porque quer isso?
Posso estar errado…
Mas acho q existe uma maneira de barrar…
Primeiro me diz o que você quer com isso que eu te conto o resto. 8)
Curiosidade…
Então… não tem jeito mesmo.
heheheh…
Pessoal, alguém sabe qual eh o comando colocado no web.xml q faz com que naum seja executado scriplets…
Valeu…
-
Veja no PDF que pode ser baixado desta página
http://jcp.org/aboutJava/communityprocess/final/jsr152/ qual é o comando necessário. O nome do PDF (depois de você ter de percorrer um monte de páginas de licença) é jsp-2_0-fr-spec.pdf. -
Veja se seu web container implementa JSP 2.0.
- Na página 1-89 do PDF:
JSP.3.3.3 Disabling Scripting Elements
With the addition of the EL, some JSP page authors, or page authoring groups,
may want to follow a methodology where scripting elements are not allowed. Previous
versions of JSP enabled this through the notion of a TagLibraryValidator that
would verify that the elements are not present. JSP 2.0 makes this slightly easier
through a JSP configuration element.
The scripting-invalid element is a subelement of jsp-property-group (see 3.3.1).
It has no subelements. Its valid values are true and false. Scripting is enabled by
default. Disabling scripting elements can be done by setting the scripting-invalid
element to true in the JSP configuration.
For example, the following web.xml fragment defines a group that disables
scripting elements for all JSP pages delivered using the .jsp extension:
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<scripting-invalid>true></scripting-invalid>
</jsp-property-group>
>
Beleza thingol…
Valeu cara…
Pior que tem mesmo.
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<scripting-invalid>true</scripting-invalid>
</jsp-property-group>
Inclusive para EL também:
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<el-ignored>true</el-ignored>
</jsp-property-group>
Preciso me atualizar.
heheheh…
… em informatica eh assim mesmo tem coisas que a gente nem imagina que existe…
Valeu pela ajuda também danieldestro…
Alguem pode postar um web.xml de exemplo pra JSP pra min?
VELO
Faz aquilo que te falei, joga eles na raíz do projeto e tenta acessar…
Galera eh o seguinte:
Esse código naum tah sendo reconhecido pelo IDEA e eu importei o jar JSP 2.0…
Alguem sabe pq???
Como assim não tá sendo reconhecido?
Do que o IDEA tá reclamando?
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<scripting-invalid>true</scripting-invalid>
</jsp-property-group>
O IDEA naum reconhece esse código que invalida scriptlets em páginas JSP…Você sabe pq???
Isso deve ser que vc tah utilizando um dtd pra validação do seu web.xml…
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
Pelo menos para algumas tags específicas do jsp 2.0 vc tem q utilizar o Schema de validação da jsp2.0.
Algo como:
<?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">