You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dragan Stankovic <sf...@gmail.com> on 2007/09/14 01:37:42 UTC

[s2] Creating a part of some form using macro

I have multiple forms which sometimes have similar parts (for instance couple
of fields required for entering the address). For that similar parts I want
to avoid code duplication so I was thinking of doing that by using
freemarker macro orderDataForm with a parameter orderDataObject:

<#macro orderDataForm orderDataObject>
...
<tr>
	<td>Street:</td>
	<td>
  		<@s.textfield theme="simple" name="orderDataObject.street" 
  				value="%{orderDataObject.street}" cssStyle="width: 200px;"/>
  	</td>
</tr>
...
</#macro>

I call that macro with something like this:

<#assign address>
    <@s.property value="user.destinationAddress"/>
</#assign>
<@orderDataForm orderDataObject=address />

I have added the assign before actual call of the macro because user object
is undefined in the first displaying of a form and freemarker complains on
this.
destinationAddress is actually an object with several properties like
street, zipcode, state, ...
When I try this (I have filled destinationAddress fields with some values) I
receive nulls for the destinationAddress properties. Did I miss something?
Or maybe you have a better solution for this kind of issue...








-- 
View this message in context: http://www.nabble.com/-s2--Creating-a-part-of-some-form-using-macro-tf4439180.html#a12665754
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Plug in for Eclipse 3.2 to run struts applications

Posted by Angelo zerr <an...@gmail.com>.
Hi,

if you use struts1.x, you could use the Akrogen struts1.x
catalog<http://akrogen.sourceforge.net/struts-catalog/struts1x.html>to
generate Action, ActionForm, JSP, struts-config.
Akrogen <http://akrogen.sourceforge.net/index.html> is plugin Eclipse whee
you can write Eclipse wizard with XML/XUL. It is linked to template written
into Freemarker, Velocity or XSL.

So if the Akrogen struts1.x catalog don't please you (the wizard, the
generated code....), you can modifiy like you want.

Regards Angelo

2007/9/30, Arunkumar Balasubramanian <ar...@hotmail.com>:
>
>
> Hi
>
> Do any one have link where I can download plug in for eclipse 3.2 for
> running struts applications. I tried Easy Struts and it works only with
> eclipse 2.x and not with eclipse 3.2.
>
> I am running a application in my PC and need this plug in. If any one have
> link to download the plug in, that would be great.
>
> Thanks
>
>
> _________________________________________________________________
> Explore the seven wonders of the world
> http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE

Storing XML file which keeps updating

Posted by Arunkumar Balasubramanian <ar...@hotmail.com>.
 
Hi
 
 I was trying to store xml file which updates frequently. Here is what I was looking for.
 sample.xml is a file which keeps updating. I would like to store file upon changing. 
 For example, at 12.00 p.m, one sample.xml   
 file will be updated. At 12.01 p.m another set of data will be updated and goes on...
 
 I would like to store the file some where (I don't know where to, might be a database 
 or a temporary xml file or java objects). Either one should be fine, but I need to keep 
 track of updating and store the file at each change.
 
 I learned that Java 1.5 has some API specifications to do this. But I am not sure of 
 how to apply. Could any one in our group explain me about how to achieve this.
 
 Thank you and have a great day.
_________________________________________________________________
Climb to the top of the charts!  Play Star Shuffle:  the word scramble challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct

[OT] Re: Error on Action, Form and on org.apache.struts names while changing .classpath file

Posted by Dave Newton <ne...@yahoo.com>.
--- Arunkumar Balasubramanian wrote:
>  I was updating .classspath file 

If you need to change these settings it's generally
better to do it from within the Eclipse UI by
right-clicking on the project and choosing
"Properties" from the context menu, then selecting
"Java Build Path" and defining what source folders are
to be used and where to put the compiled classes
(which can be set for all source folders or on an
individual basis).

The *best* solution is to ask questions like this on
an Eclipse and / or MyEclipse forum, though.

d.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Error on Action, Form and on org.apache.struts names while changing .classpath file

Posted by Arunkumar Balasubramanian <ar...@hotmail.com>.
 
Hi
 
 I was updating .classspath file as compatible to source code which I have inserted inside workspace. The reason for doing this is to make .classpath file compile java files and put in classes folder as specified. I was running in to issues like if I update .classpath file, then I am getting errors on Action, Form on names like Action, Form, request, response (guess the struts names are throwing errors here).
 
 Here is .classpath file which I have changed.
 
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="TOMCAT_HOME/lib/servlet-api.jar"/>
<classpathentry kind="var" path="TOMCAT_HOME/lib/jasper.jar"/>
<classpathentry kind="var" path="TOMCAT_HOME/lib/jsp-api.jar"/>
<classpathentry kind="var" path="TOMCAT_HOME/lib/el-api.jar"/>
<classpathentry kind="var" path="TOMCAT_HOME/lib/annotations-api.jar"/>
<classpathentry kind="src" path="WEB-INF/src"/> - tried to change this path (but automatic compilation of code doesn't 
                                                                     occur here if I moved src out of WEB-INF
<classpathentry kind="src" output="work" path="work"/>
<classpathentry kind="output" path="WEB-INF/classes"/>
</classpath>
 
 I was trying some thing like not changing the .classpath file, rather arrange directories according to the file. But when I have Action or Form inside WEB_INF/src, error message appears on 
import org.apache.struts.action.*;
 
and on all other struts names like Action, request, response, etc...
 
  If any one could identify what the problem is and which one would be a solution for these kind of problems, that would be great.
 
 Thanks
 
 
 
 
_________________________________________________________________
Help yourself to FREE treats served up daily at the Messenger Café. Stop by today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

Re: Modifying Java file changes are not reflected while running Tomcar Server

Posted by Dave Newton <ne...@yahoo.com>.
--- Arunkumar Balasubramanian wrote:
>  org.apache.jasper.JasperException: An exception
> occurred processing JSP page /pages/Address.jsp at
> line 6
> 
> 3: 
> root cause javax.servlet.jsp.JspException: Missing
> message for key "welcome.title"

That means you don't have a message for the
"welcome.title" key in your resource files and doesn't
have anything to do with renaming the method name.

d.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Modifying Java file changes are not reflected while running Tomcar Server

Posted by Arunkumar Balasubramanian <ar...@hotmail.com>.
 
Hi
 
  I have downloaded source code online and were trying to reuse the files available to build my own application. I have MyEclipse IDE with Tomcat server on it. I am developing struts application. Here is what the problem I am running in to. 
 
 If I add all java, jsp, class, ear and war files available from source code (which I got online), pages are working fine. If I try to change method name (variable, get and set methods, property name in Form, action and jsp respectively) or add new method name (variable, get and set methods, property name in Form, action and jsp respectively), those changes are not reflected while running server.
 
 Even I restarted the server and workspace, I haven't got it working. This is what the error messages I am getting while running the server after altering the method name.
 org.apache.jasper.JasperException: An exception occurred processing JSP page /pages/Address.jsp at line 6

3: 
4: <html:html locale="true">
5: <head>
6: <title><bean:message key="welcome.title"/></title>
7: <html:base/>
8: </head>
9: <body bgcolor="white">


Stacktrace:
	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause javax.servlet.ServletException: javax.servlet.jsp.JspException: Missing message for key "welcome.title"
	org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
	org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
	org.apache.jsp.pages.Address_jsp._jspService(Address_jsp.java:96)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause javax.servlet.jsp.JspException: Missing message for key "welcome.title"
	org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:235)
	org.apache.jsp.pages.Address_jsp._jspx_meth_bean_005fmessage_005f0(Address_jsp.java:154)
	org.apache.jsp.pages.Address_jsp._jspx_meth_html_005fhtml_005f0(Address_jsp.java:119)
	org.apache.jsp.pages.Address_jsp._jspService(Address_jsp.java:87)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs.
 
 If any one had run in to similiar issues or any one had an idea about how to rectify this, that would be of great help.
 
 Thanks
 
 
 
_________________________________________________________________
Climb to the top of the charts!  Play Star Shuffle:  the word scramble challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct

Plug in for Eclipse 3.2 to run struts applications

Posted by Arunkumar Balasubramanian <ar...@hotmail.com>.
 
Hi
 
 Do any one have link where I can download plug in for eclipse 3.2 for running struts applications. I tried Easy Struts and it works only with eclipse 2.x and not with eclipse 3.2.
 
 I am running a application in my PC and need this plug in. If any one have link to download the plug in, that would be great.
 
 Thanks
 
 
_________________________________________________________________
Explore the seven wonders of the world
http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE

Re: Do Tiles have access to bean defined in JSP page

Posted by Antonio Petrelli <an...@gmail.com>.
2007/9/22, Arunkumar Balasubramanian <ar...@hotmail.com>:
>
> While I do this, I am not getting part page after tiles insert. The page
> remains cutted off and nothing displays after tiles:insert part.



Usually this happens when an exception happened during the rendering of the
page.
Check if you have some stack trace in your log, and post it here.

Antonio

Do Tiles have access to bean defined in JSP page

Posted by Arunkumar Balasubramanian <ar...@hotmail.com>.
 
 Is it possible to use a <bean:define id which is in JSP page in a Tile (which uses that id). I was getting a error like part of  page after tiles insert is not being displayed. I was wondering whther Tile has an access to bean which is defined in JSP page. Since the bean is taking property from page specific form, i was unable to include that in a tile. Here is where it creates problem.
          I need to call an id which is defined in JSP page in Tile. My jsp page code looks like:
<td>
     <bean:define id="addrList" name="AddForm" scope="request" property="add" type="java.util.List" />
     <tiles:insert page="/tilepage.jsp" flush="true" />
</td> Where as in tilepage.jsp the code looks like:<bean:define id="Size"value="<%=String.valueOf(addrList.size())%>" />  The <bean:define id=addrList which is in jsp page is called in tilepage.jsp calculation. While I do this, I am not getting part page after tiles insert. The page remains cutted off and nothing displays after tiles:insert part.  Does any one have idea about how to use <bean:id which is defined in jsp page in a tile. Or if there are any other ways in achieving this, could you elaborate on this.   
_________________________________________________________________
Can you find the hidden words?  Take a break and play Seekadoo!
http://club.live.com/seekadoo.aspx?icid=seek_wlmailtextlink

RE: Urgent: Is it possible to define superclass form name in jsp file

Posted by Arunkumar Balasubramanian <ar...@hotmail.com>.
Hi
 
 Let me explain you more in detail.
 
          I need to call an id which is defined in JSP page in Tile. My jsp page code looks like:<td><bean:define id="addrList" name="AddForm" scope="request" property="add" type="java.util.List" /><tiles:insert page="/tilepage.jsp" flush="true" /></td>
 
Where as in tilepage.jsp the code looks like:
<bean:define id="code1Size"value="<%=String.valueOf(code1addrList.size())%>" />
 
 The <bean:define id which is in jsp page is called in tilepage.jsp for processing. While I do this, I am not getting the page after tile insert. The page remains cutted off.
 
 Does any one have idea about how to use <bean:id which is defined in jsp page in a tile. Or if there are any other ways in achieving this, could you elaborate on this. 
 
 



> Date: Fri, 21 Sep 2007 09:10:21 +0200> From: antonio.petrelli@gmail.com> To: user@struts.apache.org> Subject: Re: Urgent: Is it possible to define superclass form name in jsp file> > 2007/9/21, Arunkumar Balasubramanian <ar...@hotmail.com>:> >> > <bean:define id="name" name="Bformname" scope="request"/>> >> > With this piece of code, you are putting:> - the bean registered with the "Bformname" attribute name in thr "request"> scope> - in the page scope (that it is the default) with the attribute name "name".> > Is it really what you want?> > Antonio
_________________________________________________________________
Kick back and relax with hot games and cool activities at the Messenger Café.
http://www.cafemessenger.com?ocid=TXT_TAGLM_SeptWLtagline

RE: Urgent: Is it possible to define superclass form name in jsp file

Posted by Arunkumar Balasubramanian <ar...@hotmail.com>.
 
Thanks for your response.
 
by having <bean:define id="name" name="Bformname" scope="request"/> in a Tile.Where Bformname is super class. If I have this piece of code, the page after <tile:insert is not been displayed. Bformname is inherited in Aformname(which has reference in struts-config).
 
Is it possible to define id for Bformname which is extended class. Are there any references to be done for this in Tile or page?
 



> Date: Fri, 21 Sep 2007 09:10:21 +0200> From: antonio.petrelli@gmail.com> To: user@struts.apache.org> Subject: Re: Urgent: Is it possible to define superclass form name in jsp file> > 2007/9/21, Arunkumar Balasubramanian <ar...@hotmail.com>:> >> > <bean:define id="name" name="Bformname" scope="request"/>> >> > With this piece of code, you are putting:> - the bean registered with the "Bformname" attribute name in thr "request"> scope> - in the page scope (that it is the default) with the attribute name "name".> > Is it really what you want?> > Antonio
_________________________________________________________________
Capture your memories in an online journal!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us

Re: Urgent: Is it possible to define superclass form name in jsp file

Posted by Antonio Petrelli <an...@gmail.com>.
2007/9/21, Arunkumar Balasubramanian <ar...@hotmail.com>:
>
> <bean:define id="name" name="Bformname" scope="request"/>
>

With this piece of code, you are putting:
- the bean registered with the "Bformname" attribute name in thr "request"
scope
- in the page scope (that it is the default) with the attribute name "name".

Is it really what you want?

Antonio

Urgent: Is it possible to define superclass form name in jsp file

Posted by Arunkumar Balasubramanian <ar...@hotmail.com>.
 
Hi
 
  I would like to know whether it is possible to define super class name in JSP file. Here is what my problem is:
 
  Aformname is a form which extends Bformname (super class). A tile was created with property names in 
Bformname (super class). For defining id using 
 
<bean:define id="name" name="Bformname" scope="request"/>
 
 in Tilepage.jsp (Which is a tile, inserted in mainpage.jsp).
 
 I was getting an error, part of tile and code after Tile is being inserted is not getting displayed. 
 
Could any one suggest how to achieve this?
 
If there is a way to define an id with super class form name in Tile (JSP page), let me know how to do.
 
Thanks
 
 
 
_________________________________________________________________
Kick back and relax with hot games and cool activities at the Messenger Café.
http://www.cafemessenger.com?ocid=TXT_TAGLM_SeptWLtagline

Re: [s2] Creating a part of some form using macro

Posted by Dragan Stankovic <sf...@gmail.com>.
To put it simple (and refresh my post as well :) , my question would be:
Can I pass an object as a macro parameter, and put it as a value of a form
element's name attribute which is generated inside the macro.

Any suggestions are welcome...
-- 
View this message in context: http://www.nabble.com/-s2--Creating-a-part-of-some-form-using-macro-tf4439180.html#a12808380
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org