Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HELP need on DTD for struts-config.xml

 
perry arora
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends ,..
i need u r help..
can any one tell me the right DTD used in the struts-config.xml file ,, and what other files we need to place in the tomcat and at what location
i guess we need the validation file .. and any digester file also so that we can run the application even whenwe are not on line..
so plzz i will again place my query in better manner
(1) Which dtd to use( plz write it)
(2) What other files(validator etc etc) needed and where to place them
(3) how can we run the application even if we are not online..

any suggestion, will really be appreciated ,,
thxs
b bye
 
Yoo-Jin Lee
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
There are excellent examples that come with the struts library - look in the webapps directory.
I would recommend using the latest version 1.1.
1.http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd
2.If you want to use the validator you need to specify it in your struts-config.xml file as a plug-in.
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property value="/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml" property="pathnames" />
</plug-in>
Check out http://www.manning.com/husted - there's 2 online chapters on the tiles and validator plug-in.
3. The doctype in your tld and xml config files (web.xml, struts-config.xml, etc..) usually point to an online url such as http://jakarta.apache.org. From what I understand Tomcat and many other servers cache the dtd files. In any case, you can point the doctype to a file in your classpath.
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "/WEB-INF/struts-config_1_1.dtd">

Hope that helps. It's a little confusing at first. I'd recommend buying 'Struts in Action' http://www.manning.com/husted. It's concise and gives excellent examples.
-Yoo-Jin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic