RE: TextArea

2005-07-20 Thread Folashade Adeyosoye
Here is a solution, JavaScript by the way...


script language=JavaScript type=text/javascript
!--
var max_comment=150;
var clr=0;
function Counter(field){
var len=0;
len+=field.value.length;
if (len  max_comment){
alert(The User Comments field has a limit of  + max_comment + 
characters.\n\n You have entered  + len +  characters.);
field.value=field.value.substring(0,field.value.length+max_comment-len);
field.focus();
}
}

// --
/script



html:textarea property=userComment cols=40 rows=3
onkeydown=Counter(this); onkeyup=Counter(this);
titleKey=title.Comment/



Shardayyy



-Original Message-
From: Larry Meadors [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 20, 2005 10:56 AM
To: Struts Users Mailing List
Subject: Re: TextArea

Yep, not an option in HTML, gotta javascript it, or catch it on the server.

Larry


On 7/20/05, Mark Benussi [EMAIL PROTECTED] wrote:
 Sadly, JavaScript I am afraid.
 
 -Original Message-
 From: Vijay K Anand [mailto:[EMAIL PROTECTED]
 
 How to control char maxlength in html:textarea/ ?


-
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: submenu collapsed

2005-07-17 Thread Folashade Adeyosoye
Are you using Struts Menu?

-Original Message-
From: wade han [mailto:[EMAIL PROTECTED] 
Sent: Sunday, July 17, 2005 9:58 PM
To: user@struts.apache.org
Subject: submenu collapsed

We use template to create the dynamic left menu including main menu and
submenu, but after I press the submenu at the first time, the submenu
collapsed, we want to keep the submenu expanded.
 
Anybody has any idea about this?
 
Thanks.
 
Wade


-
 Start your day with Yahoo! - make it your home page 


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



RE: Render an html button tag

2005-06-28 Thread Folashade Adeyosoye
You can use a button


html:button property=addName value=Add Name  /


shardayyy

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 28, 2005 11:20 AM
To: Struts Users Mailing List
Subject: Re: Render an html button tag

From: Gary Cauthon [EMAIL PROTECTED]

 Using HTML, I can create a button using this syntax:
 button name=removeButton value=1remove/button
 button name=removeButton value=2remove/button

  So how do I
 do this with the struts html:button tag?  As far as I can tell, it just
 renders an tag of type input that does nothing when you click it.
 Do I need to write it myself via a taglib?

Struts html:button does render an input tag, not a button tag.
http://struts.apache.org/userGuide/struts-html.html#button

I can't say why we don't have something that renders button.  It's in the
HTML 4.01 specification so I don't think there would be any objection to
adding it if someone wanted to.  (Though what would we call it?)

Back to your issue... if the content isn't dynamic, you can just use
button directly.  If it is dynamic, you can embed a c:out tag for the
values... or just an expression if you're on a JSP 2.0 container.

-- 
Wendy Smoak



-
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: Calendar control

2005-05-04 Thread Folashade Adeyosoye
I use this...

http://www.dynarch.com/projects/calendar/




-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 04, 2005 1:23 PM
To: Struts Users Mailing List
Subject: Re: Calendar control

I've used this in the past and it works well. [JavaScript]
http://www.mattkruse.com/javascript/calendarpopup/

HTH,
Glenn




Rafael Taboada [EMAIL PROTECTED] 
04/05/2005 01:15 PM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts List user@struts.apache.org
cc

Subject
Calendar control
Classification








 Hi folks. I'm designing a module in my site where it has to control 
dates.

 Do you know if there is a project or open source control for this object?

 I mean, I need to show a calendar and all dates classified by day or
month or year...

 Please do u know anything about it?

 thanks.

-- 

 Rafael Taboada

-
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: [OT: Swing slow?] Re: ANOTHER IDE

2005-05-04 Thread Folashade Adeyosoye
JBuilder 2005 has been good to me, a little slower that JBuilder 9, with JB
2005 thay have incorporated the eclipse feel



-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 04, 2005 5:06 PM
To: Struts Users Mailing List
Subject: Re: [OT: Swing slow?] Re: ANOTHER IDE

Rick Reumann wrote:

 Eclipse was ok as far as IDE features and price tag, but it just 
 didn't 'feel' right to me. Using IDEA just feels right it, plus of 
 course it does everything and more you'd expect from an IDE. By the 
 way, who says Swing is slow? I don't think they use SWT for IDEA and 
 yet it sure is a responsive app. Eclipse actually seemed much more 
 sluggish to me on both windows and Linux.

A lot of Swing problems are due to Really Poor Swing coding--properly 
coded, Swing is fine.

My experience was similar; IDEA seemed quicker than Eclipse; no doubt 
one of those get what you pay for type things, although IDEA has been 
around longer, so I'm not terribly surprised, despite Eclipse's use of SWT.

It also seems like the new soon-to-be-released version of IDEA will 
allow even easier plugin development, probably (at least partially) a 
reaction to the Eclipse plugin model. Might have to switch myself, 
especially if I can convince (I have to fight for everything, despite 
metrics etc. that prove I'm right) the powers to invest in some freakin' 
developer tools... *sigh*

Dave



-
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: struts file upload problem

2005-05-04 Thread Folashade Adeyosoye
1 GB is Huge to upload, isn't there alimit? I thought there was

-Original Message-
From: temp temp [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 04, 2005 4:20 PM
To: user@struts.apache.org
Subject: struts file upload problem

I am using struts to upload a file . It works fine
with small files .
But  for  files with size  1Gb  it works fine when I
upload from localhost but does not work
 when I upload it from network .It gives network
exception socket connection closed by peer.
Can somebody help me with this.
thanks  regards




__ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

-
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]



Struts / JSTL c:import external websites

2005-05-03 Thread Folashade Adeyosoye
Hi all, 

 

 

   This might be a JSTL question more than a struts question, but I think
developers might have run into this problem before while developing in
Struts..

 

 

 

I was able to import my Yahoo forum into my portal like application, but the
all the links are relative to my site rather than the yahoo site, any hints
to get this to work.

 

 

 

c:import  url=http://groups.yahoo.com/group/forumName//

 

 

It shows up fine but the links defaults to my site.

 

 

.

Shardayyy

 

 



Re: ANOTHER IDE

2005-05-02 Thread Folashade Adeyosoye
This might not be in the free realm, but give JBuilder 2005 a try...

On 5/2/05, Rafael Taboada [EMAIL PROTECTED] wrote:
  Hi folks...
 
  I'm using NetBeans as IDE. But i want to know if there is another
 powerful IDE that supports working with struts...
 
  Netbeans can do ant build for me. Is there another powerful IDE? or better??
 
  thanks for ur cooperation
 
 --
 
  Rafael Taboada
 
 -
 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: Struts with PHP

2005-05-02 Thread Folashade Adeyosoye
hmm, good question, but i would not think so, one system developed in
struts can call a PHP and vise-visa, but i dont think they can be
intergrated.

1. PHP has a diff processor compared to java/jsp/struts




On 5/2/05, Rafael Taboada [EMAIL PROTECTED] wrote:
  Hi folks... I'm working right now with PHP...
 
  Is it possible to combine PHP with struts? I mean, instead to JSP, use PHP.
 
  thanks
 
 --
 
  Rafael Taboada
 
 -
 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: Struts with PHP

2005-05-02 Thread Folashade Adeyosoye
I don't see how you would be able to forward to a PHP page and have all the
fields work, one thing to consider is they do not share the same session.

Struts is a java framework, that has jar files etc, a PHP server would not
know what to do with them.


-Original Message-
From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 02, 2005 12:10 PM
To: Folashade Adeyosoye
Cc: Struts Users Mailing List; Rafael Taboada
Subject: Re: Struts with PHP

Actually, while I don't know much about PHP, I would say it *better* be
possible :)  Struts is, by and large, the C in MVC (some parts arguably
cross boundaries, but as a generality...), so if I can't swap in a
different M and V, there's probably something wrong.

I think it's probably a given that you aren't going to be able to use the
Struts taglibs on a PHP page, so some of the automatic functions of Struts
won't be available, but at the end of the day I should be able to forward
to a PHP page and have it work, even if I have to do more manual labor to
get values into fields and such.

At least, I would be expecting that to be possible.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Mon, May 2, 2005 12:05 pm, Folashade Adeyosoye said:
 hmm, good question, but i would not think so, one system developed in
 struts can call a PHP and vise-visa, but i dont think they can be
 intergrated.

 1. PHP has a diff processor compared to java/jsp/struts




 On 5/2/05, Rafael Taboada [EMAIL PROTECTED] wrote:
  Hi folks... I'm working right now with PHP...

  Is it possible to combine PHP with struts? I mean, instead to JSP, use
 PHP.

  thanks

 --

  Rafael Taboada

 -
 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: Struts with PHP

2005-05-02 Thread Folashade Adeyosoye
Because they are Oranges and Apples...


XML/XSLT are mainly file/processors that produces HTML that are universally
recognized by almost all servers.

-Original Message-
From: Stéphane Zuckerman [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 02, 2005 12:19 PM
To: Struts Users Mailing List
Subject: Re: Struts with PHP

  On 5/2/05, Rafael Taboada [EMAIL PROTECTED] wrote:
 
  Hi folks... I'm working right now with PHP...
 
  Is it possible to combine PHP with struts? I mean, instead to JSP, 
use PHP.
 

Folashade Adeyosoye a écrit :
 hmm, good question, but i would not think so, one system developed in
 struts can call a PHP and vise-visa, but i dont think they can be
 intergrated.
 
 1. PHP has a diff processor compared to java/jsp/struts
 thanks

Well, I'm not saying this is possible either... But after all, people 
manage to do Struts + XML/XSLT without JSP. So why not with PHP ?

-- 
Stéphane Zuckerman

-
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: Struts with PHP

2005-05-02 Thread Folashade Adeyosoye
Am assuming here that there is some sort of Servlets container or
application server that runs Java/Struts and there is another PHP server all
running on the same machine/box. Please explain how both containers would
manage ONE session when a user logs in and pass/manage information between
each other :)




-Original Message-
From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 02, 2005 12:30 PM
To: Struts Users Mailing List
Cc: Struts Users Mailing List
Subject: Re: Struts with PHP

I presume one can get at the parameters, attributes and headers of the
request object in a PHP script, no?  As long as you can do that, then you
should be able to replace JSP pages with PHP pages, sans the taglibs of
course, which, as some people seem to forget, are an OPTIONAL element of
Struts :) because you can get at anything Struts sends to a JSP.

Now, as for the *why* you'd want to use PHP instead of JSP, I think that's
a fair question :)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Mon, May 2, 2005 12:22 pm, Leon Rosenberg said:

 Well, I'm not saying this is possible either... But after all, people
 manage to do Struts + XML/XSLT without JSP. So why not with PHP ?


 Yes, by generating XML out of the action or jsp, and adding an XSLT
 transformer. How do you want to share any variables with a php script?

 And, after all, why should you want it at all?

 Leon.

 P.S. I think we should forget this thread asap :-)



 -
 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: Struts with PHP

2005-05-02 Thread Folashade Adeyosoye
Completely not what is been discussed.

Php.mvc is a framework on its own, doing what struts does, not interaction
between PHP and Struts.



-Original Message-
From: Kris Barnhoorn [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 02, 2005 12:28 PM
To: 'Struts Users Mailing List'; 'Rafael Taboada'
Subject: RE: Struts with PHP

http://www.phpmvc.net/ is a php port of struts

just info. Not used or tested it.

Kris.

-Oorspronkelijk bericht-
Van: Rafael Taboada [mailto:[EMAIL PROTECTED] 
Verzonden: maandag 2 mei 2005 17:59
Aan: Struts List
Onderwerp: Struts with PHP

 Hi folks... I'm working right now with PHP...

 Is it possible to combine PHP with struts? I mean, instead to JSP, use
PHP.

 thanks

-- 

 Rafael Taboada

-
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]



Struts JSTL c:import external websites

2005-04-30 Thread Folashade Adeyosoye
Hi all, 

 

 

   This might be a JSTL question more than a struts question, but I think
developers might have run into this problem before while developing in
Struts..

 

 

 

I was able to import my Yahoo forum into my portal like application, but the
all the links are relative to my site rather than the yahoo site, any hints
to get this to work.

 

 

 

c:import  url=http://groups.yahoo.com/group/forumName//

 

 

It shows up fine but the links defaults to my site.



RE: Validation Problems

2005-04-19 Thread Folashade Adeyosoye
Try using DynaValidatorActionForm...



-Original Message-
From: Andrew Thorell [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 19, 2005 10:44 AM
To: Struts Mailing List
Subject: Validation Problems

Hey all,

I've been trying for some time now to figure out what my problem is
with my Validations not displaying error messages back to the page
from where the request came from. It's a simple login page which
pretty much follows Ted's Struts in Action example.

I'm using a Form which extends ValidatorForm, using the html:errors
/ tag in my jsp.

If you need anymore code that what's below, let me know.

public static final String errors_login=lifont
color=\red\Wrong User Name and/or Password/font/li;
public static final String errors_userpassequal=liInvalid Email
Address./li;


public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request)
{
ActionErrors errors = null;
errors = super.validate(mapping, request);

if (errors == null) 
{
errors = new ActionErrors();
}

if (username.equals(password))
{
errors.add(password, new
ActionMessage(Constants.errors_login));
}
if (! org.apache.commons.validator.GenericValidator.isEmail(
getusername() ) )
{
errors.add(username, new
ActionMessage(Constants.errors_userpassequal));
}
return errors;
}

// Execute Method from my Action which extends just Action:

public ActionForward execute(ActionMapping mapping, ActionForm
form, HttpServletRequest request,
HttpServletResponse response) throws IOException,
ServletException
{
boolean validate = false;

if (!validate)
{
ActionErrors errors = new ActionErrors();
errors.add(ActionErrors.GLOBAL_MESSAGE, new   

ActionMessage(Constants.errors_login) );
saveErrors(request, errors);
// getInput() just returns to index.jsp where the html:errors / tag
resides.
return (new ActionForward(mapping.getInput() ) );
}
 }

I'm purposely making the whole validation process fail just to get any
error message to display (Which they aren't). I was going to try using
html:messages but I'm unsure how to assign the id= tag and where I
can set the attribute for it.

Thanks for any help in advance, let me know if I can clear anything up.

-
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: binary view

2005-04-18 Thread Folashade Adeyosoye
This might be a good case to write a custom tag.



-Original Message-
From: Daniel Watrous [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 18, 2005 5:20 PM
To: user@struts.apache.org
Subject: binary view

I have an action in my application that generates a PNG image from
some text stored in a session object.  My view is very simple:

[EMAIL PROTECTED] contentType=image/png%
%
java.io.OutputStream os = response.getOutputStream();
java.awt.image.BufferedImage buffer = (java.awt.image.BufferedImage)
request.getAttribute(imageBuffer);
javax.imageio.ImageIO.write(buffer,png,os);
os.close();
%

Thats it.  My action loads imageBuffer with the image data.

The first time I load the page I get the error:
java.lang.IllegalStateException: getOutputStream() has already been
called for this response

Is there a better way to accomplish what I am after?  I would prefer
to load the page one time and have it work, rather than the refresh. 
Thanks in advance...

DW

-
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]



FW: Database Assistance Needed

2005-04-16 Thread Folashade Adeyosoye
Ok let me give this a stab, this might help you

Please find the attached files, not sure if the attached file's makes its
way to the list



SampleCode = Sample code, that gets the connection etc
DBConnectionManager = manages the connection pool
DBUtil = DB utility
System.properties = configuration
DBoptions = DB options etc



All you have to do is change the system.properties to fit your need and
compile.



-Original Message-
From: Scott Purcell [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 15, 2005 4:56 PM
To: user@struts.apache.org
Subject: Database Assistance Needed

I have had some issues this past week, trying to come up with a way to
cleanly connect to my, MySQL database. I know this is not necessarily a
struts issue, but I am betting that there is no one on this list who is not
using some type of database in the back-end.

Now I have the O'Reilly book on Struts, and using the ObjectRelationalBridge
is a little too large for me to take on currently, same as Hibernate or
anything else I would have to research thoroughly. I just need a solid,
simple way to grab a connection from a pool, use it in a Business Object and
call it a day.  Since I am running on Tomcat 5.5, I have tried to
incorporate the DBCP from jakarta into my struts stuff. Problem is most
examples do not work, or are incomplete for the 5.5 Tomcat, and I cannot
find any decent examples of doing this.

I am basically Running Mysql, and Tomcat 5.5, and struts 1.2. I really do
not want to use the data-source in struts, as I intend to use a solution
that will not be depreciated in the next release. Could anyone throw me a
bone here. I have searched google to death for good examples, but come up
with outdated examples, or incomplete. The examples for Tomcat make you use
JNDI, and I am not sure if that is the way to go.

Any assistance would be sincerely appreciated.

Thanks,
Scott

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 public boolean isMemberAvailableByUserName(String memberUserName) throws
  SQLException {

boolean memberPresent = false;
Connection connection = null;
PreparedStatement statement = null;
ResultSet resultSet = null;
StringBuffer sql = new StringBuffer(512);

sql.append(SELECT MemberUserName);
sql.append( FROM  + TABLE_NAME);
sql.append( WHERE MemberUserName = ?);

try {
  connection = DBUtils.getConnection();
  statement = connection.prepareStatement(sql.toString());
  statement.setString(1, memberUserName);
  resultSet = statement.executeQuery();
  if (resultSet.next()) {
memberPresent = true;
  }
}
catch (SQLException sqle) {
  sqle.printStackTrace();
  logger.fatal(Error executing  + sql + memberUserName);
}
finally {
  DBUtils.closeResultSet(resultSet);
  DBUtils.closeStatement(statement);
  DBUtils.closeConnection(connection);
}
return memberPresent;
  }

import java.sql.*;
import java.util.*;

import org.apache.commons.logging.*;


/**
 * DBConnectionManager
 *
 * This class is a Singleton that provides access to the
 * connection pool. A client gets access to the single
 * instance through the static getInstance() method
 * and can then check-out and check-in connections from a pool.
 * When the client shuts down it should call the release() method
 * to close all opened connections and do other clean up.
 */
public class DBConnectionManager {
/**
 * Logger
 */
private static Log logger = LogFactory.getLog(DBConnectionManager.class);

/**
 * TIME_BETWEEN_RETRIES
 */
private static final int TIME_BETWEEN_RETRIES = 500; // O.5 second

/**
 * DBConnectionManager instance
 */
static private DBConnectionManager instance = null;   // The single instance

/**
 * DBConnectionPool pool
 */
private DBConnectionPool pool = null;// please be careful if u want to make this variable static

  /**
   * A private constructor since this is a Singleton Note: This constructor is
   * lightweight since DBConnectionPool is lightweight, so no connection is
   * created until the first time getConnection() is called
   *
   * @param option DBOptions
   */
  private DBConnectionManager(DBOptions option) {
try {
Class.forName(option.driverClassName).newInstance();
} catch (Exception e) {
logger.fatal(DBConnectionManager: Unable to load driver =  + option.driverClassName);
}

//if (pool == null) {//uncomment since pool is an instance variable
pool = new DBConnectionPool(option.databaseURL, option.databaseUser, option.databasePassword, option.maxConnection);
//}
}

/**
 * Returns the single instance, creating one if it's the
 * first time this method is called.
 *
 * @return DBConnectionManager The single instance.
 */

RE: Multiple struts-config.xml

2005-04-11 Thread Folashade Adeyosoye
I don’t see how you would have problems with names, if you have unique form
names, you would also have unique attribute names. Even thou you have the
same attributes:


From the example below, one can have a form attribute called id in each
struts-config.

This method had been used on a system that is live now, with no problem.


-Original Message-
From: Manfred Wolff [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 11, 2005 2:48 AM
To: Struts Users Mailing List
Subject: Re: Multiple struts-config.xml


Hi

A better way is to use struts modules. Every Module has its own 
struts-configuration. If you use more than one struts configuration such 
as described below, you  may have problems with duplicate identifiers, 
becaus struts builds one configuration out of all files. This problems 
you don't have using modules. Modules acts as a namespace in this case.

-Manfred

-- 

===
Dipl.-Inf. Manfred Wolff
Software Engineer
---
http://www.manfred-wolff.de
http://www.struts-it.org
---


Folashade Adeyosoye wrote:

Yes, in your web.xml


Change this...

  servlet
servlet-nameAppName/servlet-name
servlet-classcom.path.to.the.ActionServlet/servlet-class
init-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
/init-param
load-on-startup1/load-on-startup
  /servlet

To 


  servlet
servlet-name AppName /servlet-name
servlet-classcom.path.to.the.ActionServlet/servlet-class
init-param
  param-nameconfig/param-name
 
param-value/WEB-INF/struts-config.xml,/WEB-INF/the-employee-config.xml,/W
E
B-INF/the-admin-config.xml,/WEB-INF/the-client-config.xml,/WEB-INF/the-bill
i
ng-config.xml,/WEB-INF/the-report-config.xml,/WEB-INF/the-patient-config.xm
l
/param-value
/init-param
load-on-startup1/load-on-startup
  /servlet


-Original Message-
From: Néstor Boscán [mailto:[EMAIL PROTECTED] 
Sent: Sunday, April 10, 2005 11:04 PM
To: 'Struts Users Mailing List'
Subject: Multiple struts-config.xml

Hi
 
I have an application and I need to create many web flows. If I use struts
to model the web flows, is it possible to use many struts-config.xml
instead
of one?
 
Regards,
 
Néstor Boscán


-
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]


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



RE: Multiple struts-config.xml

2005-04-10 Thread Folashade Adeyosoye
Yes, in your web.xml


Change this...

  servlet
servlet-nameAppName/servlet-name
servlet-classcom.path.to.the.ActionServlet/servlet-class
init-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
/init-param
load-on-startup1/load-on-startup
  /servlet

To 


  servlet
servlet-name AppName /servlet-name
servlet-classcom.path.to.the.ActionServlet/servlet-class
init-param
  param-nameconfig/param-name
 
param-value/WEB-INF/struts-config.xml,/WEB-INF/the-employee-config.xml,/WE
B-INF/the-admin-config.xml,/WEB-INF/the-client-config.xml,/WEB-INF/the-billi
ng-config.xml,/WEB-INF/the-report-config.xml,/WEB-INF/the-patient-config.xml
/param-value
/init-param
load-on-startup1/load-on-startup
  /servlet


-Original Message-
From: Néstor Boscán [mailto:[EMAIL PROTECTED] 
Sent: Sunday, April 10, 2005 11:04 PM
To: 'Struts Users Mailing List'
Subject: Multiple struts-config.xml

Hi
 
I have an application and I need to create many web flows. If I use struts
to model the web flows, is it possible to use many struts-config.xml instead
of one?
 
Regards,
 
Néstor Boscán


-
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: Anxiously awaiting...

2005-04-07 Thread Folashade Adeyosoye
Try writing out  c:out value=${emply}/



On Apr 7, 2005 11:23 AM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Hi,
 
 I am anxiously awaiting for the thread between Stéphane, Rick and Niall to
 continue.
 I am experimenting with trying to do the same thing as Stéphane.
 
 In the mean time I am having one of those mornings where nothing seems to
 be going my way.
 I am trying to use JSTL for the first time and the expression does not
 seem to get evaluated.
 Ex.:
 bean:define id=emply name=HRnlnVO property=emplyVO /
 bean:write name=emply property=firstName /
 c:out value=${emply.firstName}/
 
 The bean:write line works like a charm.
 The c:out line just writes out the expression: ${emply.firstName}
 
 Why?
 
 TIA,
 Glenn


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



Re: Simple JSTL Question

2005-04-07 Thread Folashade Adeyosoye
WHY go thru all that trouble...

all you have to do is, if you do have the STATES_PROPERTIES_KEY in
the application context, all you have to do is set the ListItem.value
in your java class DynaForm.

so when them page is displaying it would automatically detect what the
value is and auto select that value in the select menu




On Apr 7, 2005 3:01 PM, Brian McGovern [EMAIL PROTECTED] wrote:
 At least i think its simple. I have this code which doesnt error.. but also 
 doesnt work.
 
 select
   c:forEach var=ListItem 
 items=${applicationScope.STATES_PROPERTIES_KEY.keyValues}
 option value=c:out value=${ListItem.key} / c:if 
 test=${sessionScope.INVESTORBEAN_SESSION_KEY.state} == ${ListItem.value}  
 SELECTED /c:ifc:out value=${ListItem.value} /
/c:forEach
 /select
 
 This loops fine and i can c:out every single piece of that code, including 
 the session var.  The problem is that I cant get this to work
 
 tried
 c:if test=${sessionScope.INVESTORBEAN_SESSION_KEY.state} == 
 ${ListItem.value}  SELECTED /c:if
 
 tried
 c:if test=${sessionScope.INVESTORBEAN_SESSION_KEY.state} eq 
 ${ListItem.value}  SELECTED /c:if
 
 In this case lets say sessionScope.INVESTORBEAN_SESSION_KEY.state = GA  and 
 one of the loop values at ${ListItem.value} = GA.  How do i get this to 
 evaluate correctly?
 
 Thanks
 
 -
 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]



Struts, Tomcat 5.0, JBuilder JPetstore

2005-04-06 Thread Folashade Adeyosoye
Was wondering if anyone has successfully loaded JPetStore Demo into
JBuilder 2005. After trying and compiling not all the classes were
compiled



Struts
JBuilder
JDK 1.5
Tomcat 5
iBatis DAO
iBatis SQLMapper

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



Re: TagLibs

2005-03-24 Thread Folashade Adeyosoye
in such a case you have to use   titleKey=img.new

here is the attribute from the struts-html.tld, i look in there most
of the times if i need to figure out which attribute a certain taglib
call take.



attribute
nametitleKey/name
requiredfalse/required
rtexprvaluetrue/rtexprvalue
/attribute


Hope that helps :)


On Thu, 24 Mar 2005 09:34:40 -0500, Rafael Taboada
[EMAIL PROTECTED] wrote:
 Greetings guys from the list. i have a problem that i hope u can help me
 
 i'm using Taglibs and i want to use bean:message inside html:img...
 But there's an error: an equal sig expected
 
 here is my code
 
 html:link href=Sales.jsp
   html:img src=../images/new.png alt=bean:message
 key=img.new/ width=24 height=24 /
 /html:link
 
 please, can u help me? where is the problem? is it possible to use
 bean tag inside a html tag???
 
 how can i solve this??
 
 thanks
 
 --
 
  Rafael Taboada
 
 -
 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: [HELP] How could I catch and process Errors in Struts + iBatis + DAO?

2005-03-24 Thread Folashade Adeyosoye
Agood way that i have found out was to define a  BaseExceptionHandler.java class

 snip  
public final class BaseExceptionHandler extends ExceptionHandler {

 public ActionForward execute(Exception ex, ExceptionConfig ae,
 ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request,
 HttpServletResponse response)
throws ServletException {
 ActionErrors errors =  (ActionErrors)
request.getAttribute(Globals.ERROR_KEY);

if (errors != null) {
return null;
}

ActionForward forward =
super.execute(ex, ae, mapping, form, request, response);

   // get user that is logged in from session
   // create a timestamp (String)
   
  StackTraceElement[] ste = ex.getStackTrace();
  StringBuffer sbStackTrace = new StringBuffer();
  for (int i = 0; iste.length; i++) {
sbStackTrace.append(ste[i].toString());
sbStackTrace.append(\n);
  }

  //  create a unique error code from   userName_Timestamp

  // Save the error code in the session
  if ( session != null ){
session.setAttribute(errorId, sb.toString());
  }  

  //return new ActionForward(ae.getPath());
  return forward;
   }  // end execute

}

 / snip  


Now in your  struts-config.xml have this in there

 global-exceptions
  exception key=errors.technical.difficulty
path=/jsp/systemError.jsp type=java.lang.Exception
handler=com.path.to.my.class.BaseExceptionHandler/
 /global-exceptions


and aboviously errors.technical.difficulty would be in the resource
properties file, waht ever message you want to display

Now in the systemError.jsp, display the errorId


This is a catch all error, design pattern..

When a user reports a error ask for the error Code on the screen and
then you check your log4J file for that error code to debug.


hope that helps :)

On Thu, 24 Mar 2005 15:04:05 +0700, Pham Anh Tuan [EMAIL PROTECTED] wrote:
 thank you very much, Yuniar :)
 
 - Original Message -
 From: Yuniar Setiawan [EMAIL PROTECTED]
 To: Struts Users Mailing List user@struts.apache.org
 Sent: Wednesday, March 23, 2005 6:57 PM
 Subject: Re: [HELP] How could I catch and process Errors in Struts + iBatis
 + DAO?
 
  There is a good example at
  http://www.reumann.net/struts/ibatisLesson1.do about this. download
  the sample war and look inside.
 
  cheers
 
 
  On Wed, 23 Mar 2005 17:31:53 +0700, Pham Anh Tuan [EMAIL PROTECTED]
  wrote:
  Hi,
 
  I don't know how to catch and process errors in Struts + iBatis + DAO.
 
  Anyone here can help me, plz :(
 
  thank for ur reading.
 
  Tuan
 
 
  -
  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: html: tag four buttons, one action problem

2005-03-23 Thread Folashade Adeyosoye
I am currently doing the same my project...


here is it...

it involves using javascript to change the buttonAction

1. must have a hidden field buttonAction
2. each (Button) submit button must have a property
3. when you click on the button the JS is involked and the hidden
filed buttonAction is set and the form is submitted
4. in your Java class, get the value of the button, if task1, do
task1, if task2 do task 2


hope that helps

-
script language=javaScript
function DoSomething(button)
{
  document.forms[0].buttonAction.value=button.value;
  document.forms[0].submit();
}
/script

-

html:form action=doAnotherThing?action=addAnotherThing 
  html:hidden property=buttonAction/
 
p
html:button 
  property=task1 
  value=Add Property   
  onclick=DoSomething(this);
/
nbsp;nbsp;nbsp;
  html:button 
  property=task2 
  value=Add Property/Sublease  
  onclick=DoSomething(this);
/
nbsp;nbsp;nbsp;
html:reset
  bean:message key=button.reset/
/html:reset
nbsp;nbsp;nbsp;
html:cancel/
%--
  bean:message key=button.cancel/
/html:cancel
--%
/p
/html:form

-



On Wed, 23 Mar 2005 14:58:56 -0600, Scott Purcell
[EMAIL PROTECTED] wrote:
 Hello,
 I have a form, lets say that has a select list on it.
 Under it I have the ability to
 [edit], [delete], [modify] or [cancel].
 
 Each of these buttons goes to a different action /
 
 but the form page is set for just one of the actions. And to top this off, I 
 cannot do a href_link, I need to submit the form to get the selected value 
 from the form.
 
 We are using links, but they are css links (See below). One of my guys said 
 we could just use the javascript (see last link) and then change the action 
 of the form, but I was hoping there was a cleaner way.**
 
 Here is the actual page links.  They appear to only do a href and not a 
 submit, but even if they did submit, I need to change action.
  The last one calls a javascript, changes the action and submits, but I feel 
 it is not clean.
 Is there a cleaner way to handle this.
 
 *Optimal would be a tag that submits to a certain action:**
 
 html:link action=/newUser styleClass=mainLinkNew 
 User/html:linknbsp;nbsp;nbsp;nbsp;
 html:link action=/editUser  styleClass=mainLinkEdit 
 User/html:linknbsp;nbsp;nbsp;nbsp;
 html:link action=/deleteUser styleClass=mainLinkDelete 
 User/html:linknbsp;nbsp;nbsp;nbsp;
 html:link action=/mainAdmin styleClass=mainLinkCancel/html:link
 html:link href=javascript:editUser(); styleClass=mainLinkFoo 
 Bar/html:linknbsp;nbsp;nbsp;nbsp;**
 
 I am sorry for all questions in this regard, but I could use some help.
 
 Scott
 


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



Re: EL Mystery

2005-03-23 Thread Folashade Adeyosoye
Or try escaping the c:out..


e.g

c:out value=${login.name} escapeXml=true/


true of false depending


hope that helps...


On Wed, 23 Mar 2005 15:56:02 -0500, Jeff Beal [EMAIL PROTECTED] wrote:
 On Wed, 23 Mar 2005 19:38:39 +, [EMAIL PROTECTED]
 [EMAIL PROTECTED] wrote:
 
  Can some one shed some light on this mystery? Also I have heard that using 
  EL outside of tags can be a security problem and that it is better to use a 
  c:out value=${EL}/ instead.
 
 The security part of this was mentioned on the list sometime in the
 last couple of weeks.  The c:out/ tags will escape any
 HTML-sensitive characters, but the straight EL language does not.  So,
 let's say that your variable 'EL' that you were using is a String:
 script language=\JavaScript\ href=\nastybad.js\/script
 
 c:out value=${EL}/ would print:
 lt;script language=quot;JavaScriptquot;
 href=quot;nastybad.jsquot;gt;lt;/scriptgt; and the user would
 just see the characters -- no harm done.
 
 ${EL} would just print the String, and whatever script is included in
 'nastybad.js' would be executed on the end-user's machine.
 
 If you are confident that the contents of your EL variable couldn't
 possibly have any harmful HTML in them, go ahead and use ${EL}.
 
 --
 Jeff Beal
 Webmedx, Inc.
 Pittsburgh, PA USA
 
 -
 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: html: tag four buttons, one action problem

2005-03-23 Thread Folashade Adeyosoye
I think with this, you would have multiple JS functions...


-Original Message-
From: Jason King [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 23, 2005 4:25 PM
To: Struts Users Mailing List
Subject: Re: html: tag four buttons, one action problem

Another thing you could do is use a js onclick handler to change the 
form element's action.
input type=submit onclick=return edit_onclick(this)  // I'm better 
at the html/js end so you'll have to figure out how to html:submit this.

function edit_onclick( oBtn ) {
   var frm = oBtn.form ; // reference to the html form the submit button 
is in.
frm.action = /editaction.do ;   // the stuff in the quotes should 
probably be replaced by some html: reference to fix the url.
return true;
}

Folashade Adeyosoye wrote:

I am currently doing the same my project...


here is it...

it involves using javascript to change the buttonAction

1. must have a hidden field buttonAction
2. each (Button) submit button must have a property
3. when you click on the button the JS is involked and the hidden
filed buttonAction is set and the form is submitted
4. in your Java class, get the value of the button, if task1, do
task1, if task2 do task 2


hope that helps

-
script language=javaScript
function DoSomething(button)
{
  document.forms[0].buttonAction.value=button.value;
  document.forms[0].submit();
}
/script

-

html:form action=doAnotherThing?action=addAnotherThing 
  html:hidden property=buttonAction/
 
   p
html:button 
  property=task1 
  value=Add Property   
  onclick=DoSomething(this);
/
   nbsp;nbsp;nbsp;
 html:button 
  property=task2 
  value=Add Property/Sublease  
  onclick=DoSomething(this);
/
   nbsp;nbsp;nbsp;
html:reset
  bean:message key=button.reset/
/html:reset
nbsp;nbsp;nbsp;
html:cancel/
%--
  bean:message key=button.cancel/
/html:cancel
--%
   /p
/html:form

---
--



On Wed, 23 Mar 2005 14:58:56 -0600, Scott Purcell
[EMAIL PROTECTED] wrote:
  

Hello,
I have a form, lets say that has a select list on it.
Under it I have the ability to
[edit], [delete], [modify] or [cancel].

Each of these buttons goes to a different action /

but the form page is set for just one of the actions. And to top this off,
I cannot do a href_link, I need to submit the form to get the selected value
from the form.

We are using links, but they are css links (See below). One of my guys
said we could just use the javascript (see last link) and then change the
action of the form, but I was hoping there was a cleaner way.**

Here is the actual page links.  They appear to only do a href and not a
submit, but even if they did submit, I need to change action.
 The last one calls a javascript, changes the action and submits, but I
feel it is not clean.
Is there a cleaner way to handle this.

*Optimal would be a tag that submits to a certain action:**

html:link action=/newUser styleClass=mainLinkNew
User/html:linknbsp;nbsp;nbsp;nbsp;
html:link action=/editUser  styleClass=mainLinkEdit
User/html:linknbsp;nbsp;nbsp;nbsp;
html:link action=/deleteUser styleClass=mainLinkDelete
User/html:linknbsp;nbsp;nbsp;nbsp;
html:link action=/mainAdmin
styleClass=mainLinkCancel/html:link
html:link href=javascript:editUser(); styleClass=mainLinkFoo
Bar/html:linknbsp;nbsp;nbsp;nbsp;**

I am sorry for all questions in this regard, but I could use some help.

Scott





-
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]