RE: Validator rule question

2006-04-08 Thread Quinn Stone
Oh. I guess you're right. Maybe you'll have to write your own validator plugin?
Or check the date in the action?

Q

-Original Message-
From: Rivka Shisman [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 08, 2006 11:02 PM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: Validator rule question


Hi Quinn,

As much as I understand the "validwhen" is more like an enhanced
"requiredif", but I need that the "date" rule on my property be checked
only when my other property has value "X". I don't think the "validwhen"
can solve this.

Am I right?

Rivka

-Original Message-
From: Quinn Stone [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 08, 2006 8:06 PM
To: 'Struts Users Mailing List'
Subject: RE: Validator rule question

Rivka, look into the "validwhen" validation. I think that should do the
trick.

Q
-Original Message-
From: Rivka Shisman [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 08, 2006 9:24 AM
To: Struts Users Mailing List
Subject: Validator rule question


Hello Friends,

 

I have a DynaValidatorForm in which there 2 String properties: action
and student_birth_date.

I have a date validation like this:

 







  

  datePatternStrict

  MM/yy

 



 

 

I need that the validation above to depend on the value of the "action"
property in the Form (i.e. if action equals "create" or "update" then do
the validation, else ignore it)

 

How can I do that?

 

Thanks

Rivka


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Validator rule question

2006-04-08 Thread Rivka Shisman
Hi Quinn,

As much as I understand the "validwhen" is more like an enhanced
"requiredif", but I need that the "date" rule on my property be checked
only when my other property has value "X". I don't think the "validwhen"
can solve this.

Am I right?

Rivka

-Original Message-
From: Quinn Stone [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 08, 2006 8:06 PM
To: 'Struts Users Mailing List'
Subject: RE: Validator rule question

Rivka, look into the "validwhen" validation. I think that should do the
trick.

Q
-Original Message-
From: Rivka Shisman [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 08, 2006 9:24 AM
To: Struts Users Mailing List
Subject: Validator rule question


Hello Friends,

 

I have a DynaValidatorForm in which there 2 String properties: action
and student_birth_date.

I have a date validation like this:

 







  

  datePatternStrict

  MM/yy

 



 

 

I need that the validation above to depend on the value of the "action"
property in the Form (i.e. if action equals "create" or "update" then do
the validation, else ignore it)

 

How can I do that?

 

Thanks

Rivka


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: MVC Dilemma

2006-04-08 Thread Larry Meadors
Yeah, then /join #funkycodemonkey and you are on monkey island.

Larry


On 4/8/06, netsql <[EMAIL PROTECTED]> wrote:
> So... how do you do it again?
> /server irc.darkmyst.org ?
> or ... (I tried in X-Chat)
>
> tia,
> .V
>
> Larry Meadors wrote:
> >
> > Join us on irc.darkmyst.org @ #funkycodemonkey, Dakota. Vent your
> > frustrations there. It's fun. ;-)
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Looking for a tutorial or complete example of using DynaValidatorForm

2006-04-08 Thread pantichd
Hello,

I have been using Struts for awhile but it was a very old (1.02) version.
Just finished upgrading my apps to Struts 1.2.7 and would like to take
advantage of the DynaValidatorForm.

I've found several articles on it and many examples. However, I haven't
found one that includes a complete example app and I am having trouble
getting it to work properly with the pieces I have.

Basically, what I want to do is create the form dynamically in the
struts-config.xml file, define the error messages in a properties file and
define the validations in a validator.xml file.

Here is what I have so far. When I try to to run my "dyna.jsp" I get a
"javax.servlet.jsp.JspException: null" error. I'v'e put breakpoints in my
action class but it never gets that far.

Any help would be greatly appreciated.

***STRUTS-CONFIG.XML


 


  


  

  



  



***WEB.XML

WEB APP
WEB APP description
 
action
org.apache.struts.action.ActionServlet


application
ApplicationResources


config
/WEB-INF/struts-config.xml


validate
true


 
dyna.jsp
/dyna.jsp


action
*.do




***VALIDATOR.XML



  

  




***DYNA.JSP
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>



Customer Name:*
  email:*
Submit






-
The information contained in this message is intended only for the
personal and confidential use of the recipient(s) named above. If
the reader of this message is not the intended recipient or an
agent responsible for delivering it to the intended recipient, you
are hereby notified that you have received this document in error
and that any review, dissemination, distribution, or copying of
this message is strictly prohibited. If you have received this
communication in error, please notify us immediately, and delete
the original message.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to include a "do" url?

2006-04-08 Thread Michael Jouravlev
I use it. Works well for me.

On 4/8/06, 王曾wang_zeng <[EMAIL PROTECTED]> wrote:
> hi:
> I think all of you have known what I mean well.I think the problem is
> caused by including an action which in the end will forward the request to
> another jsp page.That means you can't include a "forward". Actually this
> problem is solved by the modified codes I have shown you. First,I include a
> second jsp page,which is very usual,and won't have problems,then in that jsp
> page I include a do action which do a lot of things and return null. Due to
> this null returned, the request won't be forwarded to any other url and the
> request is going to be processed by the same jsp page that includes this
> action.  Then this jsp can read beans from the request,and do what it should
> do. By this approach, I duck the problem caused by including a fowarding
> action. But,I am still not very clear, I need some good comments or
> suggestions on this approach.
>
>
> 2006/4/9, Michael Jouravlev <[EMAIL PROTECTED]>:
> >
> > When you display JSP from Struts action, you forward to it. Forwarding
> > from included resource is not supposed to work properly according to
> > current SRV spec. You may want to explicitly specify flush="false" and
> > to use JSP1.2+ containers, but this will not work on Tomcat as you
> > like. It will work on Resin though.
> >
> > Try JSTL  instead of . I was told that this
> > works, though I did not verify if myself.
> >
> > Michael.
> >
> >
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Shale] Clay

2006-04-08 Thread Gary VanMatre
>From: "Gregg Bolinger" <[EMAIL PROTECTED]> 
>
> I am evaluating Shale. I realize it is a work in progress and that nothing 
> is fully finallized/stable and I expect there to be issues. I also expect 
> great things from Shale in the future and want to help track down issues for 
> development. Hence, my eval. I've got some questions about Clay... 
> 
> I have searched the mailing list archives and found psuedo answers to my 
> issues but nothing concrete. I am trying to utalize tapestry like views and 
> full HTML layout. I've read the online doc and downloaded and read the PDF 
> doc. I have also looked at the code for the Use Case Roladex which seemed 
> to just confuse me more. I know people have asked for a simpler example of 
> using Clay already, so I won't. But I would like some clarification. 
> 
> If I want to use tapestry like views and full html layout, do I need the 
> clay-template-suffix context param and do I need to map the servlet to the 
> same extension. Also the documentation shows the clay-template-suffix as 
> .clay and then the servlet mapping as .html. It states both should be the 
> same. Is HTML preferred? 
>

The default suffix for the clay html views is .html.  You can override this if 
you want using the context param in the web.xml.  



 org.apache.shale.clay.HTML_TEMPLATE_SUFFIX

.clayh
 


You also need to modify the faces servlet mapping so that the suffix you choose 
is handled by the faces servlet.

  
faces
*.html
  


> Exactly what file should I place my component declarations in and where 
> should this file reside? 
> 

The component declarations can reside under the context root or within the 
classpath but both should be registered in the web.xml.

   
   
  org.apache.shale.clay.COMMON_CONFIG_FILES
  /WEB-INF/clay-config.xml, 
/WEB-INF/clay-symbols-config.xml
   

We borrowed the prefix of  "classpath*:" from spring to indicate the config 
file should be loaded with the class loader.

   
  org.apache.shale.clay.COMMON_CONFIG_FILES
  
classpath*:org/apache/shale/usecases/symbols/clay-tiles-config.xml
   

These files will be loaded on startup.  If you are only using full html views, 
you will need to add another param
to the web.xml.  The usecase apps shows how to use three types of views in the 
same app (JSP, HTML, XML).
This is probably not a normal usecase in the real world.

 
  javax.faces.DEFAULT_SUFFIX
  .html
 


> For full HTML layout, do I need a JSP that pulls in the appropriate template 
> using the clay-shale taglib? 
> 

No, the shale-clay.jar has a self registering view handler that detects the 
suffix (.html) defined in the web.xml.  So you don't even have to use a JSP.  
There are a couple of the full HTML rolodex examples that show this option.  
The *extreme* HTML rolodex example show that you don't have to use any XML 
configs.  The complete page is defined in HTML.

The fun part to the clay is that it is a component and can be used in many 
ways.  When used in full html views, the clay component it the only child under 
the view root.  

> Is there currently any other documentation that I am not aware of concerning 
> Clay? 
> 

None that I'm aware of other than the website and the mailing list.  I think 
that Manning was considering a Shale book that had a couple chapters on using 
Clay but I'm not sure what the status is on that.  I've been threating to do 
some more of that but I'd rather contribute other ways. 

> Thanks a bunch and I look forward to Shale's growth. 
> 

Give it a look.  You might be able to help with that growth as many cool 
features like symbols came about the same way.


> Gregg Bolinger 
> 

Gary

Re: how to include a "do" url?

2006-04-08 Thread 王曾wang_zeng
hi:
I think all of you have known what I mean well.I think the problem is
caused by including an action which in the end will forward the request to
another jsp page.That means you can't include a "forward". Actually this
problem is solved by the modified codes I have shown you. First,I include a
second jsp page,which is very usual,and won't have problems,then in that jsp
page I include a do action which do a lot of things and return null. Due to
this null returned, the request won't be forwarded to any other url and the
request is going to be processed by the same jsp page that includes this
action.  Then this jsp can read beans from the request,and do what it should
do. By this approach, I duck the problem caused by including a fowarding
action. But,I am still not very clear, I need some good comments or
suggestions on this approach.


2006/4/9, Michael Jouravlev <[EMAIL PROTECTED]>:
>
> When you display JSP from Struts action, you forward to it. Forwarding
> from included resource is not supposed to work properly according to
> current SRV spec. You may want to explicitly specify flush="false" and
> to use JSP1.2+ containers, but this will not work on Tomcat as you
> like. It will work on Resin though.
>
> Try JSTL  instead of . I was told that this
> works, though I did not verify if myself.
>
> Michael.
>
>


Re: [Shale] Component name of f:facet

2006-04-08 Thread Gary VanMatre
>From: Hermod Opstvedt <[EMAIL PROTECTED]> 
>
> Hi 
> 
> I am almost done with at list that has a t:dataScroller attached to it (ref. 
> the datascroller example of the MyFaces simple webapp). There they have : 
>   columnClasses="standardTable_ColumnCentered" >
>for="data"
>fastStep="10"
>pageCountVar="pageCount"
>pageIndexVar="pageIndex"
>styleClass="scroller"
>paginator="true"
>paginatorMaxPages="9"
>paginatorTableClass="paginator"
>paginatorActiveColumnStyle="font-weight:bold;"
>actionListener="#{scrollerList.scrollerAction}"
>>
>
>
>
>
> Since facet is not defined in the shale-clay clay-config.xml file, I added a 
> definition in mine to just get going: 
>componentType="javax.faces.HtmlOutputText">
>  
> 
>  
>> 
> 
> Abviously it does not render in the same way as f:facet in MyFaces does. So 
> I tried to track down what componentType this is, but have come up with 
> nothing so far. 
> 
> Anybody know ? 

In Clay, the facet is an attribute of the component and element definitions 
(http://struts.apache.org/dtds/shale-clay-config/1_0/)

In JSF, the facet JSP tag is more of a namespace and doesn't have a component.  
It just indicates that it's not a normal child and ends up in another 
collection.  The load bundle is another one that doesn't have a component.

Give this a try:


  


  




> 
> Hermod 
> 
Gary



> 
> - 
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
> 

Re: [Shale] Component name of f:facet

2006-04-08 Thread Craig McClanahan
On 4/8/06, Hermod Opstvedt <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> I am almost done with at list that has a t:dataScroller attached to it
> (ref.
> the datascroller example of the MyFaces simple webapp). There they have :
>  columnClasses="standardTable_ColumnCentered" >
>  for="data"
> fastStep="10"
> pageCountVar="pageCount"
> pageIndexVar="pageIndex"
> styleClass="scroller"
> paginator="true"
> paginatorMaxPages="9"
> paginatorTableClass="paginator"
> paginatorActiveColumnStyle="font-weight:bold;"
> actionListener="#{scrollerList.scrollerAction}"
> >
> 
>  border="1"
> />
> 
>
> 
>
> Since facet is not defined in the shale-clay clay-config.xml file, I added
> a
> definition in mine to just get going:
>  componentType="javax.faces.HtmlOutputText">
>   
> 
>   
> 
>
> Abviously it does not render in the same way as f:facet in MyFaces does.
> So
> I tried to track down what componentType this is, but have come up with
> nothing so far.


The  tag is not actually a component tag at all ... it's just a way
to attach a facet component to an owning component.  Therefore, facets do
not participate in the tree walk that causes the view to be rendered.
Anything done with a facet is the responsibility of the owning component.

Essentially,  is just the equivalent of the following programmatic
actions:

UIComponent owner = ... // Create the owning component somehow
UIComponent facet = ... // Create the facet somehow
owner.getFacets().put("facetName", facet);

Anybody know ?
>
> Hermod


Craig


Re: MVC Dilemma

2006-04-08 Thread netsql

So... how do you do it again?
/server irc.darkmyst.org ?
or ... (I tried in X-Chat)

tia,
.V

Larry Meadors wrote:


Join us on irc.darkmyst.org @ #funkycodemonkey, Dakota. Vent your
frustrations there. It's fun. ;-)




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to refer to a bundle in the Default module ?

2006-04-08 Thread ot 811
I seem to have hit a quirk in Struts (version 1.2.7).
I have a resource bundle declared in the top-level (Default module). 
I need to refer to it
in an html:img tag within the context of a module.  I cannot figure
out how to do it.

The following syntax does not work :
html:img module='' bundle='bundlekey' pageKey='...'
In the above, the module attribute seems to have no effect on locating
the bundle, it only affects the generated URL.

If I create a dummy module and move the bundle declaration into the
dummy module, then the following
syntax does work !
html:img module='' bundle='bundlekey/dummymodule' pageKey='...'

But, this convention of the bundle attribute does not work for the
default module !
In other words, this does not work :
html:img module='' bundle='bundlekey/' pageKey='...'

Yes, I know I have a workable solution, but I would like to hear a  neater one.
Thanks in advance
Sanjeev

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



OT: preserving bullet symbols

2006-04-08 Thread klute
Hello all,

I have a Struts web app with a MySQL database backend
(MySQL ver. 4.1.18-standard). I noticed that if I pass
a form data that contains bullet symbols (a copy/paste
from a Word document which contains bullets), when the
data is retrieved later, '?' is displayed in place of
each bullet.

Can someone suggest a way to preserve these bullets or
point me to some relevant info online.

Thanks!
JS 

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Validator rule question

2006-04-08 Thread Quinn Stone
Rivka, look into the "validwhen" validation. I think that should do the trick.

Q
-Original Message-
From: Rivka Shisman [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 08, 2006 9:24 AM
To: Struts Users Mailing List
Subject: Validator rule question


Hello Friends,

 

I have a DynaValidatorForm in which there 2 String properties: action
and student_birth_date.

I have a date validation like this:

 







  

  datePatternStrict

  MM/yy

 



 

 

I need that the validation above to depend on the value of the "action"
property in the Form (i.e. if action equals "create" or "update" then do
the validation, else ignore it)

 

How can I do that?

 

Thanks

Rivka


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to include a "do" url?

2006-04-08 Thread Michael Jouravlev
When you display JSP from Struts action, you forward to it. Forwarding
from included resource is not supposed to work properly according to
current SRV spec. You may want to explicitly specify flush="false" and
to use JSP1.2+ containers, but this will not work on Tomcat as you
like. It will work on Resin though.

Try JSTL  instead of . I was told that this
works, though I did not verify if myself.

Michael.

On 4/8/06, 王曾wang_zeng <[EMAIL PROTECTED]> wrote:
>  I am developing a web site, and my work is based on the prototype
> already made by people who are in charge of designing UI. All my work start
> from the point when I get these 11 beautifully designed but static pages,
> and my task is to make them dynamic and have real meaning. To achive this
> goal,I use "" tag in these static pages to include the url of
> the page which has some function that fetch data from database and fomat
> them properly. codes are as follow:
> *
> ---index.jsp-
> //some static parts
> 
>
> ---GetProjectsAction.class-
> //...
> //fetch data from database
> //encapsulation into beans
> //put beans into request
>
> return mapping.findForward("sucess");
>
> //...
>
> ---projectsbox.jsp(sucess)---
> //read beans in request
> //formating the data
> 
> But these codes will result an exception caused by "the response has
> commitded". So I made some change to the codes.Modified codes are as follow:
> 
>  ---index.jsp-
> //some static parts
> 
>
> ---projectsbox.jsp---
> 
> //read beans in request
> //formating the data
>
>  ---GetProjectsAction.class-
> //...
> //fetch data from database
> //encapsulation into beans
> //put beans into request
> return null;
> 
> Then,they works.If anybody can know what I mean,please try to explain the
> reason to me,and I'll really appreciate your replay.
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Shale] Clay

2006-04-08 Thread Gregg Bolinger
Thanks for the link.  I saw that in the archives.  However, as then the same
is now, I am getting a 404 when trying to access the file.

Gregg

On 4/8/06, Hermod Opstvedt <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> Take a look at the sample that I have provided for this:
> http://www.opstvedt.com/div/ClayMal.zip
>
> Don't pay to much attention the actual body contents for page 2 and 3.
>
> Hermod
>
> -Opprinnelig melding-
> Fra: Gregg Bolinger [mailto:[EMAIL PROTECTED]
> Sendt: 8. april 2006 18:38
> Til: user@struts.apache.org
> Emne: [Shale] Clay
>
> I am evaluating Shale.  I realize it is a work in progress and that
> nothing
> is fully finallized/stable and I expect there to be issues.  I also expect
> great things from Shale in the future and want to help track down issues
> for
> development.  Hence, my eval.  I've got some questions about Clay...
>
> I have searched the mailing list archives and found psuedo answers to my
> issues but nothing concrete.  I am trying to utalize tapestry like views
> and
> full HTML layout.  I've read the online doc and downloaded and read the
> PDF
> doc.  I have also looked at the code for the Use Case Roladex which seemed
> to just confuse me more.  I know people have asked for a simpler example
> of
> using Clay already, so I won't.  But I would like some clarification.
>
> If I want to use tapestry like views and full html layout, do I need the
> clay-template-suffix context param and do I need to map the servlet to the
> same extension.  Also the documentation shows the clay-template-suffix as
> .clay and then the servlet mapping as .html.  It states both should be the
> same.  Is HTML preferred?
>
> Exactly what file should I place my component declarations in and where
> should this file reside?
>
> For full HTML layout, do I need a JSP that pulls in the appropriate
> template
> using the clay-shale taglib?
>
> Is there currently any other documentation that I am not aware of
> concerning
> Clay?
>
> Thanks a bunch and I look forward to Shale's growth.
>
> Gregg Bolinger
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Servlet Filter?

2006-04-08 Thread Dakota Jack
Here's how to create your own simpler and more efficient version of a
LookupDispatchAction.

First, your "buttons" will have the values "buttonName.dispatch" or whatever
name you choose in place of ".dispatch".  Once you get used to the idea, you
can do fancy things with this.  Second, you may want to override this with
"parameters" in the Struts sense of "parameters" in your mapping.  So, you
will find a method name from the request as follows:

protected static String getMethodName(HttpServletRequest request, 
ActionMapping mapping) {
String methodName  = null;
String buttonValue = null;
String paramProperty = mapping.getParameter();
if((paramProperty != null)) {
  methodName = paramProperty.substring(0,paramProperty.indexOf('.'));
} else {
  Enumeration enum = request.getParameterNames();
  while(enum.hasMoreElements()) {
buttonValue = (String)enum.nextElement();
if(buttonValue.indexOf(".dispatch") >= 0) {
  methodName = buttonValue;
  break;
}
  }
}
return methodName.substring(0,methodName.indexOf('.'));
  }

Next you get the method itself.  If there is no method, you create one and
then cache it.  This way you cache the methods you use for efficiency.

  protected Method getMethod(String name)
  throws NoSuchMethodException {
synchronized(methods) {
  Method method = (Method) methods.get(name);

  if (method == null) {
method = clazz.getMethod(name, types);
methods.put(name, method);
  }

  return (method);
}
  }

The fields you need to do this are:

  protected   Classclazz= this.getClass();
  protected staticMessageResources messages =
MessageResources.getMessageResources
("org.apache.struts.actions.LocalStrings");
  protected   HashMap  methods  = new HashMap();
  protected   Class[]  types= { ActionMapping.class,
ActionForm.class,
HttpServletRequest.class,


Likewise you may want to handle unspecified and cancelled methods.

protected ActionForward unspecified(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
  throws Exception {
String message = messages.getMessage( "dispatch.parameter",
mapping.getPath(), getMethodName(request,mapping));

throw new ServletException(message);
  }

  protected ActionForward cancelled(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
  throws Exception {

return null;
  }
}


Using these pieces in the execute method (coming up), you get the following
dispatch method:

protected ActionForward dispatchMethod(ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request,
 HttpServletResponse response,
 String name)
  throws Exception {

if (name == null) {
  return this.unspecified(mapping, form, request, response);
}

Method method = null;

try {
  method = getMethod(name);
} catch(NoSuchMethodException nsme) {
  String message = messages.getMessage("dispatch.method",
mapping.getPath(), name);
  throw nsme;
}

ActionForward forward = null;

try {
  Object args[] = {mapping, form, request, response};
  forward = (ActionForward) method.invoke(this, args);
} catch(ClassCastException cce) {
  String message = messages.getMessage("dispatch.return",
mapping.getPath(), name);
  throw cce;
} catch(IllegalAccessException iae) {
  String message = messages.getMessage("dispatch.error",
mapping.getPath(), name);
  throw iae;

} catch(InvocationTargetException ite) {
  Throwable t = ite.getTargetException();

  if (t instanceof Exception) {
throw ((Exception) t);
  } else {
String message = messages.getMessage("dispatch.error",
mapping.getPath(), name);
throw new ServletException(t);
  }
}
return (forward);
  }

The execute method is as follows:

public ActionForward execute(ActionMapping mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
  throws Exception {
String name = getMethodName(request,mapping);

if ("execute".equals(name) || "perform".equals(name)){
  // Prevent recursive calls
  String message = messages.getMessage("dispatch.recursive",
mapping.getPath());
  throw new ServletException(message);
}

 

Re: how to include a "do" url?

2006-04-08 Thread Kimani Darisha
stop being a retard!

On 4/8/06, Dakota Jack <[EMAIL PROTECTED]> wrote:
> I think you will have to say what kind of Struts you are working on.  No one
> here knows what "Struts" is anymore.
>
> On 4/8/06, 王曾wang_zeng <[EMAIL PROTECTED]> wrote:
> >
> >  I am developing a web site, and my work is based on the prototype
> > already made by people who are in charge of designing UI. All my work
> > start
> > from the point when I get these 11 beautifully designed but static pages,
> > and my task is to make them dynamic and have real meaning. To achive this
> > goal,I use "" tag in these static pages to include the url of
> > the page which has some function that fetch data from database and fomat
> > them properly. codes are as follow:
> > *
> > ---index.jsp-
> > //some static parts
> > 
> >
> > ---GetProjectsAction.class-
> > //...
> > //fetch data from database
> > //encapsulation into beans
> > //put beans into request
> >
> > return mapping.findForward("sucess");
> >
> > //...
> >
> > ---projectsbox.jsp(sucess)---
> > //read beans in request
> > //formating the data
> > 
> > But these codes will result an exception caused by "the response has
> > commitded". So I made some change to the codes.Modified codes are as
> > follow:
> > 
> > ---index.jsp-
> > //some static parts
> > 
> >
> > ---projectsbox.jsp---
> > 
> > //read beans in request
> > //formating the data
> >
> > ---GetProjectsAction.class-
> > //...
> > //fetch data from database
> > //encapsulation into beans
> > //put beans into request
> > return null;
> > 
> > Then,they works.If anybody can know what I mean,please try to explain the
> > reason to me,and I'll really appreciate your replay.
> >
> >
>
>
> --
> "You can lead a horse to water but you cannot make it float on its back."
> ~Dakota Jack~
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



SV: [Shale] Clay

2006-04-08 Thread Hermod Opstvedt
Hi

Take a look at the sample that I have provided for this:
http://www.opstvedt.com/div/ClayMal.zip

Don't pay to much attention the actual body contents for page 2 and 3.

Hermod

-Opprinnelig melding-
Fra: Gregg Bolinger [mailto:[EMAIL PROTECTED] 
Sendt: 8. april 2006 18:38
Til: user@struts.apache.org
Emne: [Shale] Clay

I am evaluating Shale.  I realize it is a work in progress and that nothing
is fully finallized/stable and I expect there to be issues.  I also expect
great things from Shale in the future and want to help track down issues for
development.  Hence, my eval.  I've got some questions about Clay...

I have searched the mailing list archives and found psuedo answers to my
issues but nothing concrete.  I am trying to utalize tapestry like views and
full HTML layout.  I've read the online doc and downloaded and read the PDF
doc.  I have also looked at the code for the Use Case Roladex which seemed
to just confuse me more.  I know people have asked for a simpler example of
using Clay already, so I won't.  But I would like some clarification.

If I want to use tapestry like views and full html layout, do I need the
clay-template-suffix context param and do I need to map the servlet to the
same extension.  Also the documentation shows the clay-template-suffix as
.clay and then the servlet mapping as .html.  It states both should be the
same.  Is HTML preferred?

Exactly what file should I place my component declarations in and where
should this file reside?

For full HTML layout, do I need a JSP that pulls in the appropriate template
using the clay-shale taglib?

Is there currently any other documentation that I am not aware of concerning
Clay?

Thanks a bunch and I look forward to Shale's growth.

Gregg Bolinger


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[Shale] Component name of f:facet

2006-04-08 Thread Hermod Opstvedt
Hi

I am almost done with at list that has a t:dataScroller attached to it (ref.
the datascroller example of the MyFaces simple webapp). There they have :








Since facet is not defined in the shale-clay clay-config.xml file, I added a
definition in mine to just get going:   

  

  


Abviously it does not render in the same way as f:facet in MyFaces does. So
I tried to track down what componentType this is, but have come up with
nothing so far.

Anybody know ?

Hermod


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[Shale] Clay

2006-04-08 Thread Gregg Bolinger
I am evaluating Shale.  I realize it is a work in progress and that nothing
is fully finallized/stable and I expect there to be issues.  I also expect
great things from Shale in the future and want to help track down issues for
development.  Hence, my eval.  I've got some questions about Clay...

I have searched the mailing list archives and found psuedo answers to my
issues but nothing concrete.  I am trying to utalize tapestry like views and
full HTML layout.  I've read the online doc and downloaded and read the PDF
doc.  I have also looked at the code for the Use Case Roladex which seemed
to just confuse me more.  I know people have asked for a simpler example of
using Clay already, so I won't.  But I would like some clarification.

If I want to use tapestry like views and full html layout, do I need the
clay-template-suffix context param and do I need to map the servlet to the
same extension.  Also the documentation shows the clay-template-suffix as
.clay and then the servlet mapping as .html.  It states both should be the
same.  Is HTML preferred?

Exactly what file should I place my component declarations in and where
should this file reside?

For full HTML layout, do I need a JSP that pulls in the appropriate template
using the clay-shale taglib?

Is there currently any other documentation that I am not aware of concerning
Clay?

Thanks a bunch and I look forward to Shale's growth.

Gregg Bolinger


Re: Servlet Filter?

2006-04-08 Thread Dakota Jack
Don't use LookupDispatchAction.  That is an obsolete solution.  Check the
archives on options.  Don't pay attention to the nasty talk in the archives,
just go check out the solutions.

On 4/7/06, Quinn Stone <[EMAIL PROTECTED]> wrote:
>
> OK. I contemplated creating a base class, but didn't like the idea of
> having to
> create a basically empty Action class for Actions that use ActionForward
> to
> forward to a jsp for display without calling an Action. And, frankly,
> thought it
> would be more complex to go learn the order of method calls of
> LookupDispatchAction to figure out what to override and when and how I
> return
> without bypassing some necessary processing. Sometimes I like the easy way
> out
> (as long as it's not crappy).
>
> Q
>
> -Original Message-
> From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 07, 2006 8:24 PM
> To: Struts Users Mailing List
> Subject: Re: Servlet Filter?
>
>
> Hi Quinn,
>
> Quinn Stone wrote:
> > 1. Does the Servlet filter seem a good solution?
>
> Yes, but not quite as described, and ironically its because of the
> answer to #2 :)
>
> > 2. If I throw an EnrollmentDingBat exception from said Servlet Filter,
> will a
> > handler defined in  catch it? My suspicion is that
> the
> filter
> > might executing too early, before struts mechanics cut in.
>
> No, it won't.  As you suspect, the filter fires before Struts gets
> involved.
>
> However, what you *can* do, is simply forward somewhere from the filter.
>   It could be straight to a JSP, or it could be to an Action mapping,
> whatever is appropriate.
>
> I think using a filter is generally a decent idea, but one thing to
> consider: what are you going to map it to?  It sounds like you have many
> possible URLs that you would need to check, hence the reason for wanting
> some "central" checkpoint in the first place.  The problem is, the
> filter is of course going to fire for *any* mapped request
> indiscriminately.  While filters, unless poorly written, tend to not add
> a horrible amount of overhead, you may not want to add any at all where
> it isn't necessary.  So, onto #3...
>
> > No, three questions:
> >
> > 3. Any better ideas?
>
> I would probably do it instead with a custom Action base class that your
> other Actions extend from.  Then, only extend from it those Actions
> where this check is needed.  I mean, if you determine its needed for all
> of them, or nearly all of them, then I'd probably go with the filter.
> If you can narrow it down to just a handful though, the custom base
> Action might be a better answer.
>
> > Q
>
> HTH,
> Frank
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> AIM: fzammetti
> Yahoo: fzammetti
> MSN: [EMAIL PROTECTED]
> Java Web Parts -
> http://javawebparts.sourceforge.net
> Supplying the wheel, so you don't have to reinvent it!
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~


Re: MVC Dilemma

2006-04-08 Thread Dakota Jack
I might do that, but I really don't have that many frustrations.  My life is
pretty much living the dream.

On 4/8/06, Larry Meadors <[EMAIL PROTECTED]> wrote:
>
> On 4/8/06, Dakota Jack <[EMAIL PROTECTED]> wrote:
> > hard to tell what you are doing.  So, despite the fact that I don't have
> a
> > lot of good feelings about Larry, I support his attitude in this
> case.  Why
> > don't you forget the "smart talk" about applications and just tell us in
> > English what you need to do and what your situation is?  If you do that,
> I
> > would be glad to help.  If you don't, good luck.
>
> /me hugs dakotaJack
>
> How come you are never on IRC? I think you would have fun there.
>
> Join us on irc.darkmyst.org @ #funkycodemonkey, Dakota. Vent your
> frustrations there. It's fun. ;-)
>
> Larry
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~


Validator rule question

2006-04-08 Thread Rivka Shisman
Hello Friends,

 

I have a DynaValidatorForm in which there 2 String properties: action
and student_birth_date.

I have a date validation like this:

 







  

  datePatternStrict

  MM/yy

 



 

 

I need that the validation above to depend on the value of the "action"
property in the Form (i.e. if action equals "create" or "update" then do
the validation, else ignore it)

 

How can I do that?

 

Thanks

Rivka


Re: [HELP] how do I catch url like http://www.myweb.com/mysite :(

2006-04-08 Thread Ted Husted
This questions seem a tad out of scope, even for this list. It's more
about programming a web server than programming a web application
framework. You might want to check with your web server vendor for the
best settings for your server. I'm not even sure that Java would be
the best platform for this use case.

-Ted.

On 4/7/06, Pham Anh Tuan <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I don't know how to catch the url like http://www.myweb.com/myweb <--- I 
> wanna do a action with this url, something like 360o yahoo did.
>
> ex: with url: 360.yahoo.com/myusername <--- you can go to my page.
>
> who know how, help me plz :(
>
> thanks in advance,
>
> bowlkhin
>


--
HTH, Ted.
** http://www.husted.com/ted/blog/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Reg: use of Application Resources

2006-04-08 Thread Ted Husted
Yes, you can specify an alternate "bundle" in the relevant tags, and
load the bundle in the struts-config. For a concrete exampole, see the
MailReader application that is bundled with Struts Action 1.2.9.
MailReader uses an alternate bundle to reference images and iconic
text.

HTH, Ted.

On 4/8/06, Shasirekha Engala <[EMAIL PROTECTED]> wrote:
> Hi
>
> can we use more than one Application Resources files in a jsp using
> 
>
>
>
> Shasi
>
>
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
HTH, Ted.
** http://www.husted.com/ted/blog/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to include a "do" url?

2006-04-08 Thread Ted Husted
To solve page composition problems, you might want to have a look at a
product like Tiles, or even SiteMesh. Tiles works quite well with
Struts Action, and there's a lot of documentation about how to use it.

* http://www.laliluna.de/first-steps-struts-tiles-tutorial.html
* http://www.learntechnology.net/sitemesh.do
* http://www.oracle.com/technology/oramag/oracle/04-may/o34dev_struts.html
* http://www.onjava.com/pub/a/onjava/excerpt/progjakstruts_14/index1.html
* http://www.developer.com/java/ent/article.php/2192411

SiteMesh works well with Struts Action, as well as a lot of other products.

* http://today.java.net/pub/a/today/2004/03/11/sitemesh.html
* http://www.onjava.com/pub/a/onjava/2004/09/22/sitemesh.html
* http://www.opensymphony.com/sitemesh/

It will take a little more tile to "ramp up" using either of these
products instead of jsp:includes, but the payoff in the end is well
worth the effort.

If you are new to  Apache Struts,  please review our latest FAQs, to
be sure that you get started "on the right foot".

* http://struts.apache.org/kickstart.html

HTH, Ted.


On 4/8/06, 王曾wang_zeng <[EMAIL PROTECTED]> wrote:
>  I am developing a web site, and my work is based on the prototype
> already made by people who are in charge of designing UI. All my work start
> from the point when I get these 11 beautifully designed but static pages,
> and my task is to make them dynamic and have real meaning. To achive this
> goal,I use "" tag in these static pages to include the url of
> the page which has some function that fetch data from database and fomat
> them properly. codes are as follow:
> *
> ---index.jsp-
> //some static parts
> 
>
> ---GetProjectsAction.class-
> //...
> //fetch data from database
> //encapsulation into beans
> //put beans into request
>
> return mapping.findForward("sucess");
>
> //...
>
> ---projectsbox.jsp(sucess)---
> //read beans in request
> //formating the data
> 
> But these codes will result an exception caused by "the response has
> commitded". So I made some change to the codes.Modified codes are as follow:
> 
>  ---index.jsp-
> //some static parts
> 
>
> ---projectsbox.jsp---
> 
> //read beans in request
> //formating the data
>
>  ---GetProjectsAction.class-
> //...
> //fetch data from database
> //encapsulation into beans
> //put beans into request
> return null;
> 
> Then,they works.If anybody can know what I mean,please try to explain the
> reason to me,and I'll really appreciate your replay.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reg: use of Application Resources

2006-04-08 Thread Shasirekha Engala
Hi

can we use more than one Application Resources files in a jsp using




Shasi






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: MVC Dilemma

2006-04-08 Thread Larry Meadors
On 4/8/06, Dakota Jack <[EMAIL PROTECTED]> wrote:
> hard to tell what you are doing.  So, despite the fact that I don't have a
> lot of good feelings about Larry, I support his attitude in this case.  Why
> don't you forget the "smart talk" about applications and just tell us in
> English what you need to do and what your situation is?  If you do that, I
> would be glad to help.  If you don't, good luck.

/me hugs dakotaJack

How come you are never on IRC? I think you would have fun there.

Join us on irc.darkmyst.org @ #funkycodemonkey, Dakota. Vent your
frustrations there. It's fun. ;-)

Larry

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to include a "do" url?

2006-04-08 Thread Dakota Jack
I think you will have to say what kind of Struts you are working on.  No one
here knows what "Struts" is anymore.

On 4/8/06, 王曾wang_zeng <[EMAIL PROTECTED]> wrote:
>
>  I am developing a web site, and my work is based on the prototype
> already made by people who are in charge of designing UI. All my work
> start
> from the point when I get these 11 beautifully designed but static pages,
> and my task is to make them dynamic and have real meaning. To achive this
> goal,I use "" tag in these static pages to include the url of
> the page which has some function that fetch data from database and fomat
> them properly. codes are as follow:
> *
> ---index.jsp-
> //some static parts
> 
>
> ---GetProjectsAction.class-
> //...
> //fetch data from database
> //encapsulation into beans
> //put beans into request
>
> return mapping.findForward("sucess");
>
> //...
>
> ---projectsbox.jsp(sucess)---
> //read beans in request
> //formating the data
> 
> But these codes will result an exception caused by "the response has
> commitded". So I made some change to the codes.Modified codes are as
> follow:
> 
> ---index.jsp-
> //some static parts
> 
>
> ---projectsbox.jsp---
> 
> //read beans in request
> //formating the data
>
> ---GetProjectsAction.class-
> //...
> //fetch data from database
> //encapsulation into beans
> //put beans into request
> return null;
> 
> Then,they works.If anybody can know what I mean,please try to explain the
> reason to me,and I'll really appreciate your replay.
>
>


--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~


how to include a "do" url?

2006-04-08 Thread 王曾wang_zeng
 I am developing a web site, and my work is based on the prototype
already made by people who are in charge of designing UI. All my work start
from the point when I get these 11 beautifully designed but static pages,
and my task is to make them dynamic and have real meaning. To achive this
goal,I use "" tag in these static pages to include the url of
the page which has some function that fetch data from database and fomat
them properly. codes are as follow:
*
---index.jsp-
//some static parts


---GetProjectsAction.class-
//...
//fetch data from database
//encapsulation into beans
//put beans into request

return mapping.findForward("sucess");

//...

---projectsbox.jsp(sucess)---
//read beans in request
//formating the data

But these codes will result an exception caused by "the response has
commitded". So I made some change to the codes.Modified codes are as follow:

 ---index.jsp-
//some static parts


---projectsbox.jsp---

//read beans in request
//formating the data

 ---GetProjectsAction.class-
//...
//fetch data from database
//encapsulation into beans
//put beans into request
return null;

Then,they works.If anybody can know what I mean,please try to explain the
reason to me,and I'll really appreciate your replay.