RE: form initialization
Hello, The Struts way to initialize a form with values retrieved in an Action is to populate an ActionForm with the values that were retrieved (e.g. by using PropertyUtils:copyProperties()) in the Action (viewDocument.do) itself. So not in the reset() method, as the main purpose of this method is to deal with checkboxes. Arjan Kok. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, December 15, 2000 3:47 PM To: [EMAIL PROTECTED] Subject: form initialization Hi I've read through the mailing list, and I see that there are several different threads that seams to be related to the issue of how to initialize a form with values. I'm sorry, but I don't find answers to my problems in these threads. My problem : I have a .jsp page with about 10 form:text. The form is used to view attributes for a document. Now I'm working on implementing "view document attributes", which should bring up a form with the attributes for a document. Here is what I though would work : An Action viewdocument.do which takes as a request parameter the id of the document to view the attributes for. This Action successfully retrieves the attributevalues for the document. Then I store a Document object in the request (I've also tried storing it in the session), and then forward to the .jsp page with form:text and a corresponding ViewForm ActionForm. In the ActionForm I have the reset method(), and in this method I get the Document object stored in the request, and populate the form properties with the correct values. So when the Struts framework calls the get methods, the values I've retrieved in the viewdocument Action should show up. Why I think the solution doesn't work : In the struts-config.xml file I've added the viewdocument action to the action-mappings, and also associated the ViewForm class. But then the reset method is called before the perform of the Action.. I've also tried without associating the Action with the ViewForm, but then the reset method is never called.. My question : Since I seem to have run out of good ideas this week (We've made some good progress on an application using Struts this week), I need some help. How can I initialize a form with values retrieved in an Action ? You might ask why I want to use a Form to view document attributes. The point is that I also have to make a edit.jsp, which obviously needs to be a form, and I want to use the same mechanism for both. My environment : Tomcat 3.2.1, Struts 1.0 (build 05122000) Have a nice weekend ! Regards Alf Hogemark
Re: Bad Multi-Threading Performances
Since read access still predominates, I'm interested in code design patterns that do not require locks for reads, but still deal with writes safely. Anyone have any good pointers? One approach is to use a readers/writers scheme where the readers are preferred, allowing multiple threads to read at the same time. Synchronization is still required but only for short periods of time for checking sentinel values. One would code like: // read method public Object someMethod() { try { _lock.startReading(); // acquires and releases monitor // do some reading } finally { _lock.stopReading(); } } Have a look at the source for the javax.swing.text package. The AbstractDocument class has a similar scheme: readLock()/readUnlock() writeLock()/writeUnlock() Or look at Doug Lea's Concurrent Programming in Java. Here's the online supplement with links to source code. http://gee.cs.oswego.edu/dl/cpj/ Matthew Harrison.
Re: nested and indexed properties in 1.0?
I sent in a patch a couple of months ago.. check the archive (?). [EMAIL PROTECTED] on 15/12/2000 19:39:21 Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc:(bcc: Ken X Horn) Subject: Re: nested and indexed properties in 1.0? Matthias Kerkhoff wrote: Is 1.0 going to have full support for nested and indexed properties? I have y forms which use property names such as "apples[2].oranges[3]" and I would really appreciate it if this was supported in 1.0. It's a simple change to support this since PropertyUtils already does it. All that needs to be done Its indeed a simple change. I'm also running a modified version of struts capable to use nested and indexed properties. I would too like this feature to be incorparated into struts. Is anyone who has implemented this modification willing to share? I need this feature yesterday, and am hoping I don't have to wait until Struts 1.0 final or (gasp) Struts 1.1. Thanks in advance, Jim Newsham
Re: WebLogic5.1
Is this a problem of weblogic and if so did any body report it to Bea already? --- Wong Kok Wai [EMAIL PROTECTED] wrote: WLS 5.1 SP 7 has been released and Struts example almost work of the box except the ApplicationResources.properties is not unjarred from the WAR lke the class files. So the work around is to first run WLS once to create the tmp_war_xx directory and add the ApplicationResources.properties to the correct path and restart WLS. __ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/ __ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/
FormTag question
Why does the 'form:form ...' tag strip any text before the final forward-slash from the 'action' attribute before looking up the ActionMapping? It seems to me that this makes it impossible to use actions whose path contains a forward-slash. For example, I would like to have a URL of the form 'http://hostname/myApp/admin/login.do' display a login form. In my struts-config.xml I have an action defined as follows; actionpath="/admin/login" type="foo.bar.LoginAction" name="loginActionForm" scope="request" input="/WEB-INF/jsp/admin/login.jsp" /action and in login.jsp I have the line; form:form action="admin/login.do" scope="request" When ActionServlet is invoked it looks up an ActionMapping under the key '/admin/login', finds it and creates the loginActionForm bean. When control is passed to the jsp page, however, the form tag strips the '/admin' part from the action and looks up the ActionMapping under the key '/login'. This doesn't exist so the tag throws a JspTagException. This could be solved by changing FormTag to behave in the same way as ActionServlet and not strip anything before the final forward-slash but I presume there is a reason for this. Does anybody have any other suggestions as to how I can get this to work? --- Howard Moore Senior Software Engineer Datapulse CTI Tel : +44 (0)1491 418000 Fax : +44 (0)1491 411459 E-mail: [EMAIL PROTECTED]
MessageTag change
Would anybody else find it useful if the 'bean:message ...' tag was modified to allow it to read a message key and arguments from a bean? What I propose is to add an optional 'name' attribute to the tag that identifies the bean to use. If this attribute is not set the tag behaves as it currently does. If it is set the 'key' and 'argX' attributes refer to properties of the bean from which the message key and arguments are read. As an example something like this: jsp:useBean id="aBean" class="package.Class"/ bean:message key="%= aBean.getMessage() %" arg0="%= aBean.getArg0() %"/ could then be written as follows: jsp:useBean id="aBean" class="package.Class"/ bean:message name="aBean" key="message" arg0="arg0"/ --- Howard Moore Senior Software Engineer Datapulse CTI Tel : +44 (0)1491 418000 Fax : +44 (0)1491 411459 E-mail: [EMAIL PROTECTED]
What's Struts ...
Annexed is an overview of the Struts architecture that I put together for my spec. I'd be very interested in any comments or criticisms, or anything I've got totally wrong. Of course, if anyone wants to use any part of this for their own project, please do. I'm now dissecting the example application (15 Dec build) to add JDBC database support along with i18n switching (per Kapur and Geary). My own application is database-centric, and I want to be sure I understand the arcitecture right before starting my own code. If anyone else has done work along these lines, I'd be very interested in your comments or samples. -- Ted Husted. What's Struts? Struts uses a switchboard, or controller, servlet to route requests to other Struts servlets. When initialized, the controller parses a configuration resource file. The configuration resource defines (among other things) the servlet mappings for the application. The controller uses these mappings to determine how to route the requests it receives. At a minimum, a mapping must include (1) the request this mapping handles and (2) the servlet that handles it. The action's servlet can then handle the request, and return a HTTP response to the controller, which the controller can pass back to the client. The action's servlet can also indicate if control should be forwarded to another action. For example, if a login succeeded, the loginAction servlet may wish to forward control to the mainMenu action. The configuration resource allows control to be forwarded by name; and an action servlet can check the configuration resource for that name at runtime. This allows an action servlet to return a "logical" response, and leave the details to the configuration resource. When forwarding control, a servlet can also include a shared object, or JavaBean, by storing it within a collection that other servlets can access. There are standard collections for a page, request, session, and application that are shared by all servlets and JSPs in the same Web application. So, one servlet can have an item added to a shopping cart bean, place the bean in the session collection, and forward control to a JSP that will display the contents of the updated cart. Since each client has their own session, they will each also have their own shopping cart. In a Struts application, most of the business logic is represented using JavaBeans. JavaBeans can also be used to manage input forms. A key problem in designing Web applications is retaining and validating what a user has entered between requests. With Struts, you can store the data for a input form in a form bean, which is automatically maintained through the user's Struts session. The form bean can be used by a JSP to collect data ... by an action servlet to validate what the user enters ... and then by the JSP again to display any validation errors, along with the other data entered. Form beans are defined in the configuration resource and linked to an action mapping by name. When a request calls for an action that uses a form bean, the controller either retrieves or creates the form bean, and passes it to the action's servlet. The action's servlet can then check the contents of the form bean before its input form is displayed, and also queue messages to be handled by the form. When ready, the action's servlet can return control with a forwarding to its input form, usually a JSP. The controller can then respond to the HTTP request and direct the client to the Java Server Page. The Struts framework includes custom tags that can automatically populate fields from a form bean. The only thing most Java Server Pages need to know about the rest of the framework is the proper field names and where to submit the form. Components like the messages set by the action's servlet can be output using a single custom tag. Other application-specific tags can also be defined to hide implementation details from the JSPs. The custom tags in the Struts framework are designed to use the internationalization features built into the Java platform. All the field labels and messages can be retreived from a message resource, and Java can automatically provide the correct resource for a client's country and language. To provide messages for another language, simply add another resource file. Other benefits to this approach are consistent labeling between forms, and the ability to review all labels and messages from a central location. For the simplest applications, an action's servlet can handle the business logic associated with a request. However, in most cases, an action's servlet should pass the request to another object, usually a JavaBean. To allow resuse on other platforms, business-logic JavaBeans should not refer to any Web application objects. The action's servlet should translate needed details from the HTTP request and pass those along to the business-logic beans
Re: App framework eval: Turbine and/or Struts - Push vs. Pull MVC
On Mon, 11 Dec 2000 22:25:59 -0800 Eric Brown writes: Ill let all know the results of the research my staff and I pursue in the following weeks, but Id welcome any feedback from users of these frameworks from architect, business layer development, UI layer development and ops perspectives. We will hopefully be contributors to some of these efforts in the future. Thanks for posting your chart, Eric. It will find a nice home in my own spec ;-). Besides the objective criteria, another important consideration is the philosophy of package and it's developers. Some of the major philosphical, or cultural, differences between Turbine and Struts is summed up nicely at http://www.mail-archive.com/turbine@list.working-dogs.com/msg02036.html This is a good case where reasonable people reading this could come away choosing one framework or the other, for equally valid reasons. When I choose something like a framework, I not only look at today's snapshot, but at the direction the package is taking in the long term. Another important consideration in an open source project is whether the development culture of Struts or Turbine is a good match with your own, in case you ever want to join the team of committers. Either package does the most important things, the question is whether it does them the way you like, and how easy it will be for you to add more of the things you like later. Some other threads related to choice of framework and architecture are: http://www.mail-archive.com/struts-user@jakarta.apache.org/msg00365.html http://www.mail-archive.com/struts-user@jakarta.apache.org/msg00747.html http://www.mail-archive.com/struts-user@jakarta.apache.org/msg00370.html -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 425-0252; Fax 716 223-2506. -- http://www.husted.com/
RE: file upload
Can I get at least a pointer to documentation about how to do this? thank you in advance, juan -Original Message- From: Juan Gargiulo [mailto:[EMAIL PROTECTED]] Sent: Friday, December 15, 2000 5:58 PM To: [EMAIL PROTECTED] Subject: file upload Hi, I'm trying to use the file upload features from struts. I know that this is suppose to be easy to use. But I keep receiving a null form in my perform method and I can't figure out the problem. JSP code: - form:form action="upload.do" name="uploadForm" method="POST" enctype="multipart/form-data" type="UploadForm" form:file property="file" / form:submit property="submit" value="Submit"/ /form:form UploadForm code: --- public final class UploadForm extends ActionForm { private FormFile file; public FormFile getFile() { return file;} public void setFile(FormFile file) {this.file = file;} } UploadAction:perform() code: public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { UploadForm fileForm = (UploadForm) form;== form is coming null FormFile file = fileForm.getFile(); . } Any help will be appreciated. juan
RE: file upload
Juan, I'll contribute a small example to struts on how to use the file upload/multipart request package -Original Message- From: Juan Gargiulo To: [EMAIL PROTECTED] Sent: 12/18/00 1:08 PM Subject: RE: file upload Can I get at least a pointer to documentation about how to do this? thank you in advance, juan -Original Message- From: Juan Gargiulo [mailto:[EMAIL PROTECTED]] Sent: Friday, December 15, 2000 5:58 PM To: [EMAIL PROTECTED] Subject: file upload Hi, I'm trying to use the file upload features from struts. I know that this is suppose to be easy to use. But I keep receiving a null form in my perform method and I can't figure out the problem. JSP code: - form:form action="upload.do" name="uploadForm" method="POST" enctype="multipart/form-data" type="UploadForm" form:file property="file" / form:submit property="submit" value="Submit"/ /form:form UploadForm code: --- public final class UploadForm extends ActionForm { private FormFile file; public FormFile getFile() { return file;} public void setFile(FormFile file) {this.file = file;} } UploadAction:perform() code: public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { UploadForm fileForm = (UploadForm) form;== form is coming null FormFile file = fileForm.getFile(); . } Any help will be appreciated. juan
Error while building struts
I'm getting the following error while trying to build struts from jakarta-struts-20001217.zip. My classpath is: c:\;.;c:\jdk1.2.2\jre\lib\rt.jar;c:\Ant\lib\jaxp.jar;c:\Ant\lib\parser.jar;C :\xalan-j_1_2_2\xalan.jar;c:\Ant\lib\optional.jar;c:\xalan-j_1_2_2\xerces.ja r;c:\j2sdkee1.2.1\lib\j2ee.jar Any ideas? P:\jakarta-strutsbuild dist Searching for build.xml ... Buildfile: P:\jakarta-struts\build.xml A nonfatal internal JIT (3.10.107(x)) error 'Relocation error: NULL relocation target' has occurred in : 'org/apache/crimson/parser/Parser2.maybeComment (Z)Z': Interpreting method. Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cgi prepare.dist: prepare.library: compile.library: [style] Transforming into P:\build\struts\library [style] Loading stylesheet P:\jakarta-struts\src\doc\stylesheets\tld.xsl dist.library: prepare.documentation: compile.documentation: [style] Transforming into P:\build\struts\documentation [style] Loading stylesheet P:\jakarta-struts\src\doc\stylesheets\struts.xsl [style] Failed to process P:\jakarta-struts\src\doc\index.xml BUILD FAILED P:\jakarta-struts\build.xml:141: java.lang.RuntimeException: Attribute child does not have an owner document! java.lang.RuntimeException: Attribute child does not have an owner document! at org.apache.xalan.xpath.xml.XMLParserLiaisonDefault.getParentOfNode(XMLParser LiaisonDefault.java:1311) at org.apache.xalan.xpath.MutableNodeListImpl.isDOMNodeAfter(MutableNodeListImp l.java, Compiled Code) at org.apache.xalan.xpath.MutableNodeListImpl.addNodeInDocOrder(MutableNodeList Impl.java, Compiled Code) at org.apache.xalan.xpath.MutableNodeListImpl.addNodeInDocOrder(MutableNodeList Impl.java:456) at org.apache.xalan.xpath.MutableNodeListImpl.addNodesInDocOrder(MutableNodeLis tImpl.java, Compiled Code) at org.apache.xalan.xpath.SimpleNodeLocator.union(SimpleNodeLocator.java, Compiled Code) at org.apache.xalan.xpath.XPath.union(XPath.java:851) at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled Code) at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled Code) at org.apache.xalan.xpath.XPath.execute(XPath.java:311) at org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren(ElemTemp lateElement.java, Compiled Code) at org.apache.xalan.xslt.ElemApplyTemplates.execute(ElemApplyTemplates.java:176 ) at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen t.java, Compiled Code) at org.apache.xalan.xslt.ElemCopy.execute(ElemCopy.java:120) at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen t.java, Compiled Code) at org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement .java:1199) at org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren(ElemTemp lateElement.java, Compiled Code) at org.apache.xalan.xslt.ElemApplyTemplates.execute(ElemApplyTemplates.java:176 ) at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen t.java, Compiled Code) at org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java, Compiled Code) at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen t.java, Compiled Code) at org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java, Compiled Code) at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen t.java, Compiled Code) at org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java, Compiled Code) at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen t.java, Compiled Code) at org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java, Compiled Code) at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen t.java, Compiled Code) at org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java, Compiled Code) at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen t.java, Compiled Code) at org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement .java:1199) at org.apache.xalan.xslt.ElemTemplateElement.processLocatedNode(ElemTemplateEle ment.java:1061) at org.apache.xalan.xpath.SimpleNodeLocator.findChildren(SimpleNodeLocator.java , Compiled Code) at org.apache.xalan.xpath.SimpleNodeLocator.step(SimpleNodeLocator.java, Compiled Code) at org.apache.xalan.xpath.SimpleNodeLocator.locationPath(SimpleNodeLocator.java :321) at org.apache.xalan.xpath.XPath.locationPath(XPath.java:964) at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled Code) at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled Code) at
iterate tags, I don't get it.
Title: iterate tags, I don't get it. Can someone point me either to somewhere in the example app where iterates are used, and if not, give me a short rundown on how the iterate tag relates to beans created in the Action classes? Thanks - Mike Campbell email: [EMAIL PROTECTED] S1 Corporation voice: 678-421-4641 Software Engineer fax: 678-421-4865 RD Department web: www.s1.com -
Re: PROPOSAL: TAG.xml-file
I'm all for having sections for developer products. Also a reminder that Dan Mandell is planning to submit his tag library integration with UltraDev to jakarta-taglibs. He said something about doing it over the break, but we will see :-) - eduard/o Richard Hart wrote: I would agree. Although a great idea, tying it into Struts does seem rather clunky. How about maybe not making it a part of struts, but having a section on the struts site for developers tools where it could go along with other handy product plugins? -- Richard Hart - businesseurope.com Junior Web Developer e: [EMAIL PROTECTED] v: 020 7961 0330 -Original Message- From: Thierry Cools [mailto:[EMAIL PROTECTED]] Sent: Friday, December 15, 2000 3:20 PM To: [EMAIL PROTECTED] Subject: Re: PROPOSAL: TAG.xml-file The Tag.xml file is really a good idea, but, in my opinion, I think it should be better to try to integrate those translators tags in the Ultradev product rather than Struts. I don't know what you think about it, but I really think that Ultradev is the place where to put them. Thierry P.S. : Thanks for your support about the translator. Thierry Cools Senior Java Developer S1 Brussels Kleine Kloosterstraat, 23 1932 st. Stevens-Woluwe Belgium Tel : +32 2 200 43 82 Email : [EMAIL PROTECTED] - Original Message - From: Robert Leland To: [EMAIL PROTECTED] Sent: Friday, December 15, 2000 3:44 PM Subject: PROPOSAL: TAG.xml-file I also would propose starting the development of a 'TAG.xml-file ' fort Dreamweaver., so users can directly design using 'custom tags' as opposed to translate existing pages.
RE: sending user to a anchor on a page.
From: Ted Husted [mailto:[EMAIL PROTECTED]] On 12/18/2000 at 5:57 PM Oleson, Rex wrote: as an example lets say that I have a user registration page. If the user inputs some bugus information I would like to return them to that exact area of the page that they need to correct the info. Besides anchors, another way to do this would be by changing the form's focus to the "first" invalid field. Most browsers will scroll to bring a form's field into focus. Not that I know how you would actually do that ... You can do that with Javascript, and I'm relatively certain that it's the only way. It's certainly possible to generate Javascript code using tag extensions; in my most recent project, we have that for precisely this purpose -- sending focus to an input field in error situations. But that's so specialized that I don't think it appropriate for a general-purpose library like struts. Best, Geoff P.S. Hi Thor! | || ||| || r a z o r f i s h , hamburg geoff simmons [ technologist ] tel (49) 40.35 53 77 92 fax (49) 40.35 53 77 20 http://www.razorfish.de
Re: iterate tags, I don't get it.
Title: iterate tags, I don't get it. On 12/18/2000 at 6:02 PM Mike Campbell wrote: Can someone point me either to somewhere in the example app where iterates are used, and if not, give me a short rundown on how the iterate tag relates to beans created in the Action classes? The winner is ... registration.jsp Here iterate automatically displays the subscriptions registered to a user, along with links to edit or delete each subscription. The subscriptions are stored as a hashtable, which is stored in the User bean. -- logic:iterate id="subscription" name="user" property="subscriptions" tr td align="left" bean:write name="subscription" property="host" filter="true"/ /td td align="left" bean:write name="subscription" property="username" filter="true"/ /td td align="center" bean:write name="subscription" property="type" filter="true"/ /td td align="center" bean:write name="subscription" property="autoConnect"/ /td td align="center" app:linkSubscription page="/editSubscription.do?action=Delete" bean:message key="registration.deleteSubscription"/ /app:linkSubscription app:linkSubscription page="/editSubscription.do?action=Edit" bean:message key="registration.editSubscription"/ /app:linkSubscription /td /tr/logic:iterate
RE: sending user to a anchor on a page.
Ted Husted wrote: another way to do this would be by changing the form's focus to the "first" invalid field. ... Not that I know how you would actually do that ... On 12/19/2000 at 12:45 AM Geoffrey Simmons wrote: You can do that with Javascript, and I'm relatively certain that it's the only way. I just had a vague idea about getting Struts to write the Javascript by somehow changing the focus property for the form tag. Which is the part I'm not sure about. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 425-0252; Fax 716 223-2506. -- http://www.husted.com/
Re: Re[2]: sending user to a anchor on a page.
On 12/19/2000 at 2:12 AM Matthias Kerkhoff wrote: If present, the form tag generates a little JavaScript, that sets the focus to the form field named like the "focus" attribute. The form attribute is still current, and used in the example application. But how would you change it in response to a validation error? -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 425-0252; Fax 716 223-2506. -- http://www.husted.com/
Re: Error while building struts
Dan Cancro wrote: I'm getting the following error while trying to build struts from jakarta-struts-20001217.zip. My classpath is: c:\;.;c:\jdk1.2.2\jre\lib\rt.jar;c:\Ant\lib\jaxp.jar;c:\Ant\lib\parser.jar;C :\xalan-j_1_2_2\xalan.jar;c:\Ant\lib\optional.jar;c:\xalan-j_1_2_2\xerces.ja r;c:\j2sdkee1.2.1\lib\j2ee.jar Would it be possible to try this build without the "j2ee.jar" file on the class path? I'm concerned that it might contain some classes that conflict with Xalan. Also, you are using Ant 1.2, right? Craig McClanahan Any ideas? P:\jakarta-strutsbuild dist Searching for build.xml ... Buildfile: P:\jakarta-struts\build.xml A nonfatal internal JIT (3.10.107(x)) error 'Relocation error: NULL relocation target' has occurred in : 'org/apache/crimson/parser/Parser2.maybeComment (Z)Z': Interpreting method. Please report this error in detail to http://java.sun.com/cgi-bin/bugreport.cgi prepare.dist: prepare.library: compile.library: [style] Transforming into P:\build\struts\library [style] Loading stylesheet P:\jakarta-struts\src\doc\stylesheets\tld.xsl dist.library: prepare.documentation: compile.documentation: [style] Transforming into P:\build\struts\documentation [style] Loading stylesheet P:\jakarta-struts\src\doc\stylesheets\struts.xsl [style] Failed to process P:\jakarta-struts\src\doc\index.xml BUILD FAILED P:\jakarta-struts\build.xml:141: java.lang.RuntimeException: Attribute child does not have an owner document! java.lang.RuntimeException: Attribute child does not have an owner document! at org.apache.xalan.xpath.xml.XMLParserLiaisonDefault.getParentOfNode(XMLParser LiaisonDefault.java:1311) at org.apache.xalan.xpath.MutableNodeListImpl.isDOMNodeAfter(MutableNodeListImp l.java, Compiled Code) at org.apache.xalan.xpath.MutableNodeListImpl.addNodeInDocOrder(MutableNodeList Impl.java, Compiled Code) at org.apache.xalan.xpath.MutableNodeListImpl.addNodeInDocOrder(MutableNodeList Impl.java:456) at org.apache.xalan.xpath.MutableNodeListImpl.addNodesInDocOrder(MutableNodeLis tImpl.java, Compiled Code) at org.apache.xalan.xpath.SimpleNodeLocator.union(SimpleNodeLocator.java, Compiled Code) at org.apache.xalan.xpath.XPath.union(XPath.java:851) at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled Code) at org.apache.xalan.xpath.XPath.execute(XPath.java, Compiled Code) at org.apache.xalan.xpath.XPath.execute(XPath.java:311) at org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren(ElemTemp lateElement.java, Compiled Code) at org.apache.xalan.xslt.ElemApplyTemplates.execute(ElemApplyTemplates.java:176 ) at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen t.java, Compiled Code) at org.apache.xalan.xslt.ElemCopy.execute(ElemCopy.java:120) at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen t.java, Compiled Code) at org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement .java:1199) at org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren(ElemTemp lateElement.java, Compiled Code) at org.apache.xalan.xslt.ElemApplyTemplates.execute(ElemApplyTemplates.java:176 ) at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen t.java, Compiled Code) at org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java, Compiled Code) at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen t.java, Compiled Code) at org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java, Compiled Code) at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen t.java, Compiled Code) at org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java, Compiled Code) at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen t.java, Compiled Code) at org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java, Compiled Code) at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen t.java, Compiled Code) at org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java, Compiled Code) at org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElemen t.java, Compiled Code) at org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement .java:1199) at org.apache.xalan.xslt.ElemTemplateElement.processLocatedNode(ElemTemplateEle ment.java:1061) at org.apache.xalan.xpath.SimpleNodeLocator.findChildren(SimpleNodeLocator.java , Compiled Code) at org.apache.xalan.xpath.SimpleNodeLocator.step(SimpleNodeLocator.java, Compiled Code)
Re: sending user to a anchor on a page.
Ted Husted wrote: Ted Husted wrote: another way to do this would be by changing the form's focus to the "first" invalid field. ... Not that I know how you would actually do that ... On 12/19/2000 at 12:45 AM Geoffrey Simmons wrote: You can do that with Javascript, and I'm relatively certain that it's the only way. I just had a vague idea about getting Struts to write the Javascript by somehow changing the focus property for the form tag. Which is the part I'm not sure about. One approach might be to use a runtime expression as the value of the "focus" attribute. Then, your action could set some appropriate request attribute to the name of the field to be focused on, and your expression could pick up the value. At least with the most recent nightly 1.0 builds, all of the custom tags take runtime expressions for all attributes. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 425-0252; Fax 716 223-2506. -- http://www.husted.com/ Craig
Re: Still problems parsing struts-config.xml
Jannik Nørgaard Steen wrote: Hi, I've continue to have problems with parsing the struts-config.xml. As Craig pointed out I've now included the missing DOCTYPE-element in the struts-config.xml. From the stacktrace below you can see that the ActionServlet tries to locate a dtd from a alternate location which is the dtd in the struts.jar. Why is it doing that ? The dtd is already present at the jakarta site. Then the Digester throws an exception because it cannot find the dtd file in the struts.jar, which also is weird since I've included the struts.jar in my webapp /WEB-INF/lib directory. I'm using Struts 20001712 binary dist., Xerces-1.1.3, Resin 1.1.5, JDK 1.3.0 (see also the attached xml files) I have heard that some app servers have problems loading resources from the JAR files, and unpacking struts.jar into WEB-INF/classes fixed it. I don't remember whether Resin was one of those or not, but it might be worth a try. Any suggestions ? Craig McClanahan
RE: sending user to a anchor on a page.
Perhaps an interstitial jsp like this? % String url = request.getParameter("url"); String anchor = request.getParameter("anchor"); String whereTo = url + "#" + anchor; response.sendRedirect(whereTo); % referenced in action.xml as: ... inputForm="interstitial.jsp?url=page.jspanchor=anchorName" ... If your servlet engine throws an exception on the redirect, you could alternately write in a meta refresh tag, with the downside that the interstitial would show up in the browser. D. -- David Noll, Public Digital [EMAIL PROTECTED] -Original Message- From: Oleson, Rex [mailto:[EMAIL PROTECTED]] Sent: Monday, December 18, 2000 5:57 PM To: '[EMAIL PROTECTED]' Subject: sending user to a anchor on a page. I was wondering if there was any way to send a user to a specific portion of a page after the action class has executed. as an example lets say that I have a user registration page. If the user inputs some bugus information I would like to return them to that exact area of the page that they need to correct the info. So there is the page userReg.jsp The Form class UserRegForm.java the Action class UserRegAction.java what I was thinking for the action.xml doc is something like action path="/RegisterUser" actionClass="com.userapp.UserRegAction" formAttribute="UserRegForm" formClass="com.userapp.UserRegForm" inputForm="/RegisterUser/userReg.jsp" forward name="success" path="/App/ShowInfo.action"/ forward name="failure" path="/RegisterUser/userReg.jsp"/ forward name="badzip" path="/RegisterUser/userReg.jsp#zip"/ /action where zip is the name of an anchor on userReg.jsp This does not work though all I get is a 404 error and nothing in the webservers output or log files. Any help or suggestions would greatfully appreciated. Thank you, Rex Oleson