GeeCON Prague 2014*
The moose likes Struts and the fly likes Attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Attribute "scope" is not allowed when attribute "name" is not specified...Error?" Watch "Attribute "scope" is not allowed when attribute "name" is not specified...Error?" New topic
Author

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

suja ganesan
Greenhorn

Joined: Jun 28, 2004
Posts: 7
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
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30587
    
154

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
suja ganesan
Greenhorn

Joined: Jun 28, 2004
Posts: 7
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

Joined: Jun 28, 2004
Posts: 7
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
Marshal

Joined: May 26, 2003
Posts: 30587
    
154

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.
 
GeeCON Prague 2014
 
subject: Attribute "scope" is not allowed when attribute "name" is not specified...Error?