File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes controller tags in RequestProcessor's class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "controller tags in RequestProcessor Watch "controller tags in RequestProcessor New topic
Author

controller tags in RequestProcessor's class

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1376
When i add two controller tags for two RequestProcessor's class in struts-config.xml, i am getting the error.
kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1376
ie: How can i add two RequestProcessor classes within the controller tag.
<controller
processorClass="a.b.c.d.RequestProcessor1"/>
<controller
processorClass="a.b.c.d.RequestProcessor2"/>
KArol Muszynski
Ranch Hand

Joined: Aug 09, 2005
Posts: 45
kri shan,

you can't. You can have only one controller. Just look into struts-config_1_2.dtd file.


'?' means that You can have zero or one occurence of controller tag.

Why do You want to have two controllers ?

Best Regards,
KArol Muszynski
kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1376
if i change dtd like this <!ELEMENT struts-config (display-name?, description?, data-sources?, form-beans?, global-exceptions?, global-forwards?, action-mappings?, controller?, controller?, message-resources*, plug-in*)> Will struts-config.xml accepts 2 controller tags.
KArol Muszynski
Ranch Hand

Joined: Aug 09, 2005
Posts: 45
kri shan,

Struts are designed to use one controller and changing dtd will not help. You can rewrite or extend struts but also I don't think it's a good idea.
Tell us why do You want to use more then one controller. Maybe we can help You with Your architectural problem.

Best Regards,
KArol Muszynski
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: controller tags in RequestProcessor's class