web.xml validation ?

Hi,

How do you make Idea recognize (ie: not underline every element) a 2.4
web.xml ?

Thanks,

BoD

0
Avatar
Permanently deleted user

Are you using the 2.4 DTD?

Norris Shelton
Sun Certified Java Programmer




BoD wrote:

Hi,

>

How do you make Idea recognize (ie: not underline every element) a 2.4
web.xml ?

>

Thanks,

>

BoD

0
Avatar
Permanently deleted user

It's not a dtd. I'm using that :

foo bar.foo]]>
(...)

In this particular example, Idea shows servlet-name and servlet-class in
red. It also shows the xmlns in red, and offers to fetch or ignore it,
which doesn't solve the problem if I do either.

BoD


Norris Shelton wrote:

Are you using the 2.4 DTD?

Norris Shelton
Sun Certified Java Programmer




BoD wrote:

>> Hi,
>>
>> How do you make Idea recognize (ie: not underline every element) a 2.4
>> web.xml ?
>>
>> Thanks,
>>
>> BoD

0
Avatar
Permanently deleted user

Anybody got a solution ?
Should I submit this as a bug ?

BoD

BoD wrote:

It's not a dtd. I'm using that :

<?xml version="1.0" encoding="utf-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 web-app_2_4.xsd"
version="2.4">
<servlet>
<servlet-name>foo<servlet-name>
<servlet-class>bar.foo</servlet-class>
(...)

In this particular example, Idea shows servlet-name and servlet-class in
red. It also shows the xmlns in red, and offers to fetch or ignore it,
which doesn't solve the problem if I do either.

BoD

0
Avatar
Permanently deleted user

I bet it knows nothing about using xml schema. Changes for Servlet 2.4
are still on the table. Probably part of the JSP 2.0 request.

Norris Shelton
Sun Certified Java Programmer




BoD wrote:

Anybody got a solution ?
Should I submit this as a bug ?

>

BoD

>

BoD wrote:

>
>> It's not a dtd. I'm using that :
>>
>> >> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd" >> version="2.4"> >> >> foo >> bar.foo >> (...) >> >> In this particular example, Idea shows servlet-name and servlet-class >> in red. It also shows the xmlns in red, and offers to fetch or ignore >> it, which doesn't solve the problem if I do either. >> >> BoD >]]>

0
Avatar
Permanently deleted user

Hi,

xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd" is
not supported yet. You can use appropriate <!DOCTYPE for the validation
to work properly.

BoD wrote:

It's not a dtd. I'm using that :

<?xml version="1.0" encoding="utf-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 web-app_2_4.xsd"
version="2.4">
<servlet>
<servlet-name>foo<servlet-name>
<servlet-class>bar.foo</servlet-class>
(...)

In this particular example, Idea shows servlet-name and servlet-class in
red. It also shows the xmlns in red, and offers to fetch or ignore it,
which doesn't solve the problem if I do either.

BoD


Norris Shelton wrote:

>> Are you using the 2.4 DTD?
>>
>> Norris Shelton
>> Sun Certified Java Programmer
>>
>>
>>
>>
>> BoD wrote:
>>
>>> Hi,
>>>
>>> How do you make Idea recognize (ie: not underline every element) a
>>> 2.4 web.xml ?
>>>
>>> Thanks,
>>>
>>> BoD


--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Avatar
Permanently deleted user

Could you give an example of how to do this ?

Thanks

0
Avatar
Permanently deleted user

Hi,
The one created by IDEA by default:
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

Andrew Bethell wrote:

Could you give an example of how to do this ?

Thanks



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Avatar
Permanently deleted user

I want to use the 2.4 web xml though - maybe I didnt read the thread properly - is it just not possible to have IDEA validate this properly at present ?

0
Avatar
Permanently deleted user

Hi,

I was not noticed 2.4 version, sorry.

for 2.4 the appropriate descriptor is

<web-app version="2.4"
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" >
</web-app>

The difference is in location of the resource (in your version it is
declared to be locally and IDEA does not support local schemas)

Andrew Bethell wrote:

I want to use the 2.4 web xml though - maybe I didnt read the thread properly - is it just not possible to have IDEA validate this properly at present ?



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Avatar
Permanently deleted user

Doesn't change anything :)
It's still all red (build #2128)

BoD



Maxim Mossienko wrote:

Hi,

I was not noticed 2.4 version, sorry.

for 2.4 the appropriate descriptor is

<web-app version="2.4"
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" >
</web-app>

The difference is in location of the resource (in your version it is
declared to be locally and IDEA does not support local schemas)

Andrew Bethell wrote:

>> I want to use the 2.4 web xml though - maybe I didnt read the thread
>> properly - is it just not possible to have IDEA validate this properly
>> at present ?


0
Avatar
Permanently deleted user

I finally got it working using the following:

<web-app version="2.4"
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/web-app_2_4.xsd">

Hope this helps.

0

请先登录再写评论。