This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Attribute "scope" is not allowed when attribute "name" is not specified...Error?

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am trying to set up the web application in WSAD 5.0 which is working fine in WSAD 4.0.3. I imported that EAR file into WSAD 5.0 and set up the datasource configuration and Test Environment. Everything works OK.

But there is an error in the struts-config.xml file which shows in WSAD 5.0

"Attribute "scope" is not allowed when attribute "name" is not specified"

But in WSAD 4.0.3 there is no error in the same struts-config.xml file.

Can anybody came across this problem or can you please tell me anything I am doing wrong here.

Thanks,
Suja.G
 
author & internet detective
Posts: 42056
926
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suja,
The message is correct that there is in error. The dtd requires a scope attribute. The difference is that WSAD 5 shows these errors by default where WSAD 4 does not.
 
suja ganesan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jeanne

Thanks for your reply. I mentioned the "Scope" attribute in the struts-config.xml file.

WSAD 5.0 is giving an error for the below line... in the <action> tag.

<action path="/Search" type="searchAction" scope="session">
<forward name="success" path="searchresult.jsp"/>
</action>

Please tell me what I need to do to correct the above problem.

Thanks,
Kumaran.S
 
suja ganesan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Below is the action tag I mentioned in the struts-config.xml file. It has the "scope" attribute.

<action path = "/Example" type ="ExampleAction" scope="session">
<forward name = "success" path=myexample.jsp"/">
</action>

Please tell me whether I am doing wrong here. If not, what I need to do to correct the above error. Even I specified the scope attribute in the action tag.

Your response is appreciated.

Thanks,
Suja.G
 
Jeanne Boyarsky
author & internet detective
Posts: 42056
926
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suja,
If you are specifying the scope attribute, you need to also set a form for the action (using the name attribute.) If you are not using a form, you can leave out the scope attribute entirely.

I'm moving this post to Web Application Frameworks as it is now a question about Struts, rather than WSAD.
 
She's out of the country right now, toppling an unauthorized dictatorship. Please leave a message with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic