Re: Struts 1 Logging

2014-05-30 Thread Mark Shifman



On 05/30/2014 08:26 AM, Usha Ladkani wrote:

Now empty log file is being created.

I see this error in systemout which i printed too

[30/5/14 12:23:48:824 UTC] 0086  R UOW= source=SystemErr org=IBM
prod=WebSphere component=Application Server thread=[WebContainer : 0]
   log4j:WARN No appenders could be found for logger
(com.ibm.bcg.consoleUI.action.partners.PartnerCreateAction).
[30/5/14 12:23:48:839 UTC] 0086  R UOW= source=SystemErr org=IBM
prod=WebSphere component=Application Server thread=[WebContainer : 0]
   log4j:WARN Please initialize the log4j system properly.


Below is my property file looks like

log4j.logger.org.apache.struts=DEBUG, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=usha.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=[%d{MM/dd/yy HH:mm:ss}] source=%c
thread=[%t] %m%n

Here is yet another example that I use with struts 1 with some additional 
comments.
Here is yet another example of a log4j.properties file that seems to work. (At 
least for an example for you to play with)

log4j.rootCategory=INFO, A2
# A2 is a DailyRollingFileAppender
#
log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A2.ImmediateFlush=true
log4j.appender.A2.file=${catalina.home}/logs/myapp_log.txt
log4j.appender.A2.datePattern='.'-MM-dd
log4j.appender.A2.append=true
log4j.appender.A2.layout=org.apache.log4j.PatternLayout
log4j.appender.A2.layout.ConversionPattern=%-5p %d{ISO8601} %M(%F:%L)%n%m%n

# Set Struts/Commons log level
log4j.logger.org.apache.struts=INFO
log4j.logger.org.apache.commons=INFO
log4j.logger.org.displaytag=WARN
log4j.logger.org.apache.struts.validator=WARN

log4j.logger.org.apache.commons.validator.GenericTypeValidator=ERROR
log4j.logger.org.apache.struts.chain.commands.servlet.CreateAction=WARN
log4j.logger.org.apache.struts.chain.ComposableRequestProcessor=WARN
log4j.logger.org.apache.struts.action.ActionServlet=WARN
log4j.logger.org.apache.struts.util.PropertyMessageResources=ERROR
log4j.logger.org.apache.struts.action.ActionMapping=ERROR

log4j.logger.org.exolab.castor.mapping.Mapping=WARN

The file needs  to be in your classes directory on you file path

you also have to make sure that catalina.home is known from somewhere.  I use 
jsvc to start tomcat as a daemon and have
an tomcat service file (using centos or redhat) that has these lines.
# Source function library.
. /etc/init.d/functions

# Adapt the following lines to your configuration
CATALINA_HOME=/home/apache-tomcat-7.0.20
DAEMON_HOME=/home/apache-tomcat-7.0.20/bin
TOMCAT_USER=tomcat

CATALINA_OPTS= -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true 
-XX:+UseNUMA -XX:+UseParallelGC -Xms1024M -Xmx1024M -XX:MaxPermSize=512M 
CLASSPATH=\
$JAVA_HOME/lib/tools.jar:\
$CATALINA_HOME/bin/commons-daemon.jar:\
$CATALINA_HOME/bin/bootstrap.jar:\
$CATALINA_HOME/bin/tomcat-juli.jar
...
I think I had to add tomcat-juli.jar to the CLASSPATH above.

Also there is src code you have to compile to make a tomcat-juli.jar that 
will understand log4j.


2.

Download or build |tomcat-juli.jar| and |tomcat-juli-adapters.jar| that are available as an 
extras component for Tomcat. See Additional Components documentation 
http://tomcat.apache.org/tomcat-7.0-doc/extras.html for details.

This |tomcat-juli.jar| differs from the default one. It contains the full 
Apache Commons Logging implementation and thus is able to discover the presense 
of log4j and configure itself.


I hope this helps without creating more opacity.
mas




On Fri, May 30, 2014 at 4:48 PM, Christoph Nenning 
christoph.nenn...@lex-com.net wrote:


Hello Paul.

Now I have configured log4j-1.2.13.jar. Below is my log4j.properties

file

content.

log4j.rootLogger=DEBUG, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=usha.log
log4j.appender.R.MaxFileSize=10MB
log4j.appender.R.MaxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=[%d{MM/dd/yy HH:mm:ss}]

source=%c

thread=[%t] %m%n

I get log file names usha.log created m But it doesnt has any struts
related logging after I perform the action. Just the below content is
logged.

[05/30/14 09:14:21]
source=com.ibm.bcg.consoleUI.action.partners.PartnerCreateAction
thread=[WebContainer : 3] Logging initialized.
[05/30/14 09:14:21]
source=com.ibm.bcg.consoleUI.action.partners.PartnerCreateAction
thread=[WebContainer : 3] Log4jProperties: C:\Program
Files\ibm\bcghub-distrib\wasND\Profiles\bcgprofile\installedApps
\wpgCell\BCGConsole.ear\console.war\WEB-INF\lib\log4j.properties

Which are logged by my action class.

Could you please help if I am missing something.

Thanks
Usha



You need a line like this:

log4j.logger.org.apache.struts=DEBUG


Regards,
Christoph

This Email was scanned by Sophos Anti Virus



--
Mark Shifman MD

Re: SV: Upgrade from 1.2 to 1.3x

2010-05-25 Thread Mark Shifman
I don't think you need any of the  taglib taglib-uri stuff.
(I have been using struts 1.3.10 without any of this in web.xml).
Tomcat is smart  enough to look in /META-INF/tld/ of the tag library jars.

On 05/25/2010 09:38 AM, Søren Blidorf wrote:
 Hi. Thanks.
 
 Thats where I am looking.
 
 What I am not sure about is weather I have to change the reference in all my
 jsp or I still will be able to refer to the taglibs from my web.xml
 
 So that next time the reference is changed I could change it on place.
 
 Soren, DK
 
 -Oprindelig meddelelse-
 Fra: Struts Two [mailto:struts...@yahoo.ca] 
 Sendt: 25. maj 2010 14:56
 Til: Struts Users Mailing List
 Emne: Re: Upgrade from 1.2 to 1.3x
 
 Look at the following page for migration from 1.2 to 1.3:
 
 http://wiki.apache.org/struts/StrutsUpgradeNotes12to13
 
 
 
 - Original Message 
 From: Søren Blidorf so...@nolas.dk
 To: struts-u...@jakarta.apache.org
 Sent: Tue, May 25, 2010 6:23:51 AM
 Subject: Upgrade from 1.2 to 1.3x
 
 Hi.
 
 
 
 I am upgrading my struts app to 1.3.10 from 1.2
 
 
 
 In my web.xml I have configured taglib like this:
 
 
 
   taglib
 
 taglib-uri/WEB-INF/struts-bean.tld/taglib-uri
 
 taglib-location/WEB-INF/struts-bean.tld/taglib-location
 
   /taglib
 
   taglib
 
 taglib-uri/WEB-INF/struts-html.tld/taglib-uri
 
 taglib-location/WEB-INF/struts-html.tld/taglib-location
 
   /taglib
 
   taglib
 
 taglib-uri/WEB-INF/struts-logic.tld/taglib-uri
 
 taglib-location/WEB-INF/struts-logic.tld/taglib-location
 
   /taglib
 
   taglib
 
 taglib-uri/WEB-INF/struts-tiles.tld/taglib-uri
 
 taglib-location/WEB-INF/struts-tiles.tld/taglib-location
 
   /taglib
 
   taglib
 
 taglib-uri/WEB-INF/struts-nested.tld/taglib-uri
 
 taglib-location/WEB-INF/struts-nested.tld/taglib-location
 
   /taglib
 
 
 
 Is that still ok to do? From the struts Wiki it looks like I have to refer
 directly to http://struts.apache.org/tags-bean
 
 
 
 Soren, DK
 
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

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



struts-blank-1.3.10.war has memory leak.

2010-05-13 Thread Mark Shifman
Hi:

I have been trying to track down a memory leak in my struts 1.3.10 web app.
I am using tomcat 6.0.26 which has a leak detector button in the manager app.

After basically gutting my app to a start up page, it occurred to me that I 
should
just see if the struts-blank web app has a memory leak. Well, when I deploy and 
undeploy
the struts-blank web app and check for memory leaks, it has a memory leak.

If I do this a couple of times, take a heap dump and use eclipse mat (memory 
analysis tool)
plug in, I see several WebAppClassLoaders.  When I look for duplicate classes I 
see a bunch
of org.apache.commons.beanutils classes in these WebAppClassLoaders.

I can't really go any farther in characterizing the leak since I don't 
understand enough about
classloaders.  This seems like a bug to me.

Any ideas would be appreciated?

mas

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



Re: Simple two button form - Struts 1.2.x

2009-12-10 Thread Mark Shifman
Use EventDispatchAction or just use javascript to go to the action you 
want when the button is pushed.

mas
davargas123 wrote:

I am putting in page that loads at the beginning of my application, and all
it has two buttons that should end up forwarding to do one of two different
actions. How can I distinguish between which button has been pushed inside
the Action class so that I can forward it to the correct page? The JSP and
Action are as follows, so far:


JSP: 


%...@taglib uri=/taglib/struts-html prefix=html%
%...@taglib uri=/taglib/struts-bean prefix=bean%


html:form method=post action=/SSNChoose 
bean:define id=ssnLookupForm name=ssnLookupForm
type=com.thomson.west.pubrec.optout.ui.form.SSNLookupForm /
div style=text-align: center; font-family: arial;
div class=productsdiv style=margin: 0 auto; padding: 5px;
text-align: left;
input type=submit name=Single Encryption
value=Single-Encryption/
div class=spacernbsp;/div
input type=submit name=Batch Encryption
value=Batch-Encryption/
/div
div class=spacernbsp;/div
/div
/html:form


Java class:

public class SSNChooseAction extends Action{

private static final Logger log =
Logger.getLogger(SSNChooseAction.class.getName());

public ActionForward execute( ActionMapping mapping, ActionForm form,
HttpServletRequest request,

HttpServletResponse  response){

ActionForward fwd = null;

if(Some code that can tell me which button is pressed){
fwd = mapping.findForward(single);
}else{
fwd = mapping.findForward(batch);
}


return fwd;
}

}

  



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



Re: Struts HTML taglib vs. Standard HTML tags

2009-12-04 Thread Mark Shifman
Come on, at least tell us the strut version.

I happen to be using struts 1.3.10 and if you look in
/META-INF/tld/struts-html.tld of the struts-taglib-1.3.10 jar you will find
urihttp://struts.apache.org/tags-html/uri

so i use
%@ taglib uri=http://struts.apache.org/tags-html; prefix=html%

mas

davargas123 wrote:
 When I change the standard HTML tags of my .jsp page into the Struts tags,
 the page loads up completely blank, aside from what is loaded by the
 tiles-def. What could be causing this? I'm thinking that's why my page
 doesn't submit data to the actionform, but I don't see why it wouldn't be
 rendering the struts tags at all. For instance, if I even add ONE struts tag
 in the middle of my working code that isn't the html:form tag, the entire
 jsp page will not be rendered at all. It's driving me nuts, I've been
 working on figuring this out for far too long and would greatly appreciate
 some input.
 
 
 ---JSP---
 %...@taglib uri=/taglib/struts-html prefix=html%
 %...@taglib uri=/taglib/struts-bean prefix=bean%
 %...@page import=com.thomson.west.pubrec.optout.ui.servlet.SSNLookupAction
 %
   
 script
 function encryptSSN(){
 document.ssnLookupForm.submit();
 }
 
 
 function showError(){
 document.getElementById('error').style.display='block';
 document.getElementById('box1').style.display='none';
 }
 
 function validateSSN(){
 var ssn = document.ssnLookupForm.ssn.value;
 if( /^\d{3}-\d{2}-\d{4}$/.test(ssn) == false ){
 showError();
 }else{
encryptSSN();
 }
 }
 /script
 html:form method=post action=/SSNLookupEncrypt
 div style=text-align: center; font-family: arial;
   div class=productsdiv style=margin: 0 auto; padding: 5px;
 text-align: left; width: 43%
  div
 SSN: input type=text name=ssn
 value=%=ssnLookupForm.getSSN()%/
 div class=spacer /div
 Format: XXX-XX-
  /div
  div class=spacer /div
  div style=text-align: center;
input type=button value=Encrypt onclick=validateSSN()/
  /div
  div class=textBox id=box1 style=text-align: center;
 display:block
  div class=spacer /div
Encrypted Value: %=ssnLookupForm.getEncryptedSSN()%
/div
   /div
   div class=spacer /div
/div
 /html:form
 --
 This is the corresponding ActionForm:
 
 public class SSNLookupForm extends ActionForm{
 
 private static Logger log =
   Logger.getLogger(SSNLookupForm.class.getName());

 private String ssn = XXX-XX-;
 private String encryptedSSN = [Encrypted Value];

 public String getSSN(){
 return ssn;
 }

 public void setSSN(String ssn){
 this.ssn = ssn;
 }

 public String getEncryptedSSN(){
 return encryptedSSN;
 }

 public void setEncryptedSSN(String encryptedSSN){
 this.encryptedSSN = encryptedSSN;
 }

 public void reset(ActionMapping mapping, HttpServletRequest request)
 {
 this.ssn = XXX-XX-;
 this.encryptedSSN= [Encrypted Value];
 }

 }
 
 


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



Re: Taglib to refence html in Struts 1.3.8

2009-12-01 Thread Mark Shifman
%@ taglib uri=http://struts.apache.org/tags-html; prefix=html%
seems to work for me

bladu wrote:
 Hi, 
 
 I would be very grateful If somebody could say to me what is the Struts
 taglib equivalent in Struts 1.3.8 to the taglib below allocated in Struts
 1.2   
 
 %@ taglib uri=http://jakarta.apache.org/struts/tags-html; prefix=html%
 
 Thanks
 
 Regards


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



Re: [DispatchAction] no handler parameter

2009-11-01 Thread Mark Shifman
I have also gotten this error and it was not obvious how it happened 
since the appropriate parameters were
where they were supposed to be.  You need to think of weird causes like 
double clicking a link that contains parameters or
some how the form is submitted twice, the second time the command 
parameter is not initialized.  If an action was bookmarked
you can also potentially have problems.  I don't think this is a problem 
of DispatchAction or any of its relatives, MappingDispatchAction etc.  I 
think it is a problem with a funky request.


mas


Paul Benedict wrote:

Unspecified will be called if your command parameter does not exist.

On Tue, Oct 20, 2009 at 12:39 AM, Sachi N mais...@yahoo.co.jp wrote:
  

Hello

I posted this question 9months ago but could not get any solutions.
I wonder if anyone can give me some clue now.



My client reported that they have received this error only once.
Request[/app/Keyword] does not contain handler parameter named 'command'.
at org.apache.struts.actions.DispatchAction.unspecified(DispatchAction.java:222)

They tried to replicate the error to find the cause by doing the exact same 
operation that
the user did, but they were unable.
I've been trying too but I can't figure it out.

I have the following code within a jsp:

.
.

SCRIPT LANGUAGE=JavaScript
!--
   var loadingflg = false;

   function submitExecute(mode, frm, message)
   {
   if (loadingflg == false) {
   if (message != ) {
   if (!window.confirm(message)){
   return false;
   }
   }
   eval(document.forms[0]. + mode).value = frm;
   loadingflg = true;
   document.forms[0].submit();
   }
   return false;
   }
--
.
.
.
html:form action=/app/Keyword onsubmit=return false
html:hidden property=command /

html:button property=regist onclick=return submitExecute('command', 'regist', 
'Regist?');Regist/html:button

/html:form

When you click the 'Regist' button it goes off and registers the data on the 
screen.
I didn't use LookupDispatchAction but DispatchAction.


My struts-config.xml is as follows

   action path=/app/Keyword
type=app.controller.KeywordAppAction
name=KeywordAppForm
scope=session
validate=false
parameter=command
 forward name=success path=/app/Keyword.jsp redirect=false/
   /action

Struts ver is 1.2.9 and the user is using FireFox2.0.
I wonder why this happened?
The client has not gotten the same error since they reported it a couple of 
weeks ago.
Just to avoid that the error happens again, I can override unspecified method.
But they wants to know the cause more than countermeasures.

Does anybody have suggestions?

Thanks

Sachi

--
GyaO! - Anime, Dramas, Movies, and Music videos [FREE]
http://pr.mail.yahoo.co.jp/gyao/

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





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

  



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



Re: struts1 - html:hidden tag

2009-03-05 Thread Mark Shifman
2) actually assigns the value 
1) gets the value of the property from the formbean if it has been assigned in 
the formbean.
You may have an action that populates the form by hitting a database, loading 
the data in the form
and the forwarding to your current page ie before editing a record.

mas
Emi Lu wrote:
 Good morning,
 
 A question about struts1 html:hidden tag.
 
 May I know the differences between (1) vs. (2) please?
 (1)html:hidden property=field1 /
 (2)html:hidden property=field1 value= /
 
 
 When I load value from popup windows, it seems that default value will
 be setup on (1); while (2) always return value=.
 
 Could someone let me know why? I am lost why default value will cause
 problem.
 
 Thanks a lot
 ---
 Lu Ying
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 


-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

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



Re: struts1 - html:hidden tag

2009-03-05 Thread Mark Shifman
I am not really sure what you are doing?? If you need a datasource and have set 
it up appropriately
in your context.xml see
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html(for 
tomcat 6.0)
you get the datasource doing something like this:


Context initContext = new InitialContext();
Context envContext  = (Context)initContext.lookup(java:/comp/env);
DataSource ds = (DataSource)envContext.lookup(jdbc/myoracle);

in an action.  You don't need to have a datasource as a hidden field.
mas


 Hi Mas,
 
 2) actually assigns the value 
 1) gets the value of the property from the formbean if it has been assigned 
 in the formbean.
 You may have an action that populates the form by hitting a database, 
 loading the data in the form
 and the forwarding to your current page ie before editing a record.
 
 If I'd like to load value from datasources into , in my jsp file, (1) should 
 always be used; otherwise, (2) will rewritten the form value to  ?
 
 Thanks,
 -- 
 Lu Ying
 
 
 (1)html:hidden property=field1 /
 (2)html:hidden property=field1 value= /


 When I load value from popup windows, it seems that default value will
 be setup on (1); while (2) always return value=.

-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 mark.shif...@yale.edu

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



Re: html:select for a string list

2008-12-10 Thread Mark Shifman
Try using html:options instead of optionsCollection.

elyes sallem wrote:
 Hello,
 i have a html:select in a html:form
 this select is build from a ListString valLis, defined in an actionForm
 i used the html:select in a list of object , it work
 but now it is a list of string, so i have not value and label
 i need just to recuperate the value and set the list of string
 what must i add as attribute to html:optionCollection,
 here is html:select
 nested:select property=selectedVal 
 html:optionsCollection property=valList name=intaffForm /
 /nested:select
 
 Regards
 Elyes.
 


-- 
 Mark Shifman MD. Ph.D.
 Yale Center for Medical Informatics
 Phone (203)737-5219
 [EMAIL PROTECTED]

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



Re: Is it hard to migrate from struts 1.2.x to 1.3.x ??

2007-09-05 Thread Mark Shifman

Not particularly.  There is a nice discussion on the struts wiki page:
http://wiki.apache.org/struts/StrutsUpgradeNotes12to13

Ed snooper wrote:

Hello,

In general is it hard to migrate an existing application from struts 1.2.x to 
1.3.x?

Ed

   
-

Choose the right car based on your needs.  Check out Yahoo! Autos new Car 
Finder tool.

  



--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



Re: refresh problem

2007-05-31 Thread Mark Shifman
I had a similar problem that I never really worked out and I will be 
interested in

hearing if anyone has solved this.

I was wondering if this was a caching issue with your browser.  I had 
the problem with

firefox.
any suggestions appreciated.
mas
Volkan OZYILMAZ wrote:

Hello All,

I use sturts 2. My web program work well but when i add a refresh link 
in my

page, starting a problem.

First i had use javascript:reload() function. When use this link, page
sometimes not get data. But sometimes get. I change my reload() function.

script name=javascript
function refresh()
{
   var sURL = unescape(window.location.pathname);
   window.location.href = sURL;
}
/script
a href=javascript:refresh();Yenile/a

This is old style and working.

After, i prepared a small report page. It has JFreeChart's charts. It is
working but when i add a refresh link it has a problem. I research 
ajax. I

change my refresh link

s:url id=ajaxTest value=CampaignManagerCallDurationSlice.action
   s:param name=id value=${id} /
/s:url
brbrbr
s:a theme=ajax href=%{ajaxTest} targets=Div1 
notifyTopics=/request

Yenile/s:a


But result not change. I watched this process. Page not waiting action 
class

work done. Page has waiting and show result but action class still
working.

It can be possible a settings in action mapped xml file? Or any 
suggestion?


Regards,




--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



Re: Displaytag

2007-05-16 Thread Mark Shifman

Displaytag works fine for me in struts1.3 just doing the things below.
Perhaps you need to re-deploy your webapp or re-start tomcat.
mas

Balazs Michnay wrote:

Dear Struts users,

I've recently downloaded displaytag-1.1 and followed all the instructions on 
how to install it.
It would have been too nice if it had worked immediately, but I get this 
annoying error message all the time.
I ask you guys how to solve this, because I found no posts on this specific 
error.

When I paste the taglib line (%@ taglib uri=http://displaytag.sf.net; 
prefix=display %) in my jsp, I get the following error message:

The absolute uri: http://displaytag.sf.net cannot be resolved in either web.xml or 
the jar files deployed with this application.

The documentation says that all I should do is to put the jars in my WEB-INF/lib and 
paste the %@ taglib uri. % line in the jsp. It doesn't say that I should 
make modification in my web.xml...

Any ideas what to do now?

Thanks a lot,

BM




 

We won't tell. Get more on shows you hate to love 
(and love to hate): Yahoo! TV's Guilty Pleasures list.
http://tv.yahoo.com/collections/265 

  



--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



Re: How to change the Context Root of a webapplication

2007-04-20 Thread Mark Shifman

I don't think this is a struts issue.

Look in the tomcat wiki
http://wiki.apache.org/tomcat/HowTo#head-e82228c43a0ce77f71ebe64fc99ced33c9506ffe
How do I override the default home page loaded by Tomcat?

mas
Gurram, Srinivas wrote:
Hi 


I am new to struts. Currently my application url is like this
http://www.site.com/contextname/Home.do  I want to change this url to
http://www.site.com/Home.do

I need to remove the contextname. It refers to the application name
under webapps.

Could any one suggest the solution.



Thanks in Advance

Regards
Srinivas.


This e-mail and any attachment is for authorised use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by, any other party. If you are not an intended 
recipient then please promptly delete this e-mail and any attachment and all 
copies and inform the sender. Thank you.

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

  



--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



Re: DispachAction - does not contain specified method

2007-03-13 Thread Mark Shifman

You should look at the source
http://svn.apache.org/viewvc/struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/DispatchAction.java?view=markup
and the javadoc
Method which is dispatched to when there is no value for specified 
request parameter included in the request. Subclasses of 
DispatchAction should override this method if they wish to provide 
default behavior different than throwing a ServletException.


overriding unspecified should do the trick

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

log.error(message);

*throw* *new* ServletException(message);
}

mas
Nitin Ahuja wrote:

Hi,

I am using DispatchAction as my base action class.

when submit url http://.../myAction.do?action=view; and there is no
view method defined in my action class, then it throws following
exception.

Is there any way to call a default method  when the method view does
not exists ?
Or how can I redirect or forward the request to a default page ?

javax.servlet.ServletException: Action[/myAction] does not contain
specified method (check logs)
at 
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535) 

at 
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433) 

at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) 

at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at 
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720) 

at 
org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118) 

at 
org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278) 


at java.security.AccessController.doPrivileged(Native Method)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505) 

at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505) 

at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203) 

at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505) 

at 
com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157) 


at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)


Thanks,
-Nitin

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




--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



Re: combining chain of commands with struts action

2007-01-19 Thread Mark Shifman
This seemed to do the trick along with creating my own 
custon_chain-config.xml

servlet

   init-param
   param-namechainConfig/param-name
   param-value
   org/apache/struts/chain/chain-config.xml,
   /WEB-INF/custom-chain-config.xml
   /param-value
   /init-param
..
   /servlet

This works for defining an action via the catalog/command
   action path=/MyChainAction catalog=mycat command=mychain
   name=MyChainActionForm validate=true scope=request
   input=theinput.jsp
   forward name=success
   path=thesuccess.jsp /
   /action

I also had no problem getting things out of a form within a command eg:
public boolean execute(ActionContext context) throws Exception {
   LazyValidatorForm theForm = 
(LazyValidatorForm)context.getActionForm();

   String somefield  = (String)theForm.get(thefield);
   ...
   context.getRequestScope().put(theresult, theresult);
   return false;
}


Joe Germuska wrote:

It is unlikely that you need to use the ChainListener in a Struts
1.3.xapplication.

First, you can have the ActionServlet instantiate all of your command
catalogs by specifying the servlet init parameter chainConfig with a
comma-separated list of classpath or servlet resources.  Remember that if
you manually provide this property, you must be sure to include the 
default

Struts chain (org/apache/struts/chain/chain-config.xml) or one which
establishes an alternate processing chain, in addition to any of your own
which are used purely for per-request custom mappings.

Once you've done that, you can use the catalog and command attributes 
of an
action to cause Struts to invoke that command for a request instead 
of, or

in addition to an action.  (The command will be executed first if you
specify both a command and a type.)

You can count on your commands used in an action mapping being invoked 
with

a Context which is actually a subclass of ActionContext and use that to
access the request/response/mapping/form and the like which would be 
passed

in to an Action's execute method.

Please note that I don't think a whole lot of people have been using this
feature, so you may well find bugs or even simply find that it could use
some refinements.  But this is the basic overview of how it's supposed to
work.

I hope this helps.

Joe


On 1/19/07, manunixx [EMAIL PROTECTED] wrote:



hallo guys!
I spent a lot of time trying to retrive a catalog from a struts 
action but

i
didn't get results! :(
Following the guidelines found in the jakarta commonsChain, I did this:

defining a catalog.xml catalog.../catalog
adding a ChainListener to web.xml
defining a parameter org.apache.commons.chain.CONFIG_CLASS_RESOURCE to
tell
the listener where to locate the catalog.xml

trying to retrive the catalog parsed from an action by doing:

Catalog catalog = CatalogFactory.getInstance().getCatalog(); // this
return
null

Question: do I have to config a CatalogFactory before?

can anyone suggest me any reference or updated documentation regarding
struts action and common chain?

I saw that action mapping in struts-config.xml do accepts parameters
catalog and command.
Do I have to use these to interact with commands?

Please halp me, I'm getting Nuts!
Emanuele.

--
View this message in context:
http://www.nabble.com/combining-chain-of-commands-with-struts-action-tf3039447.html#a8447680 


Sent from the Struts - User mailing list archive at Nabble.com.


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








--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



Re: Struts2, DisplayTags OGNL-error

2006-12-13 Thread Mark Shifman
)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
 at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:213)
 at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:178)
 at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:126)
 at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:105)
 at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:107)
 at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1
48)
 at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:86
9)
 at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proc
essConnection(Http11BaseProtocol.java:664)
 at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint
.java:527)
 at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollow
erWorkerThread.java:80)
 at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:684)
 at java.lang.Thread.run(Thread.java:595)
ERROR (061212 20:29:29) Developer Notification (set webwork.devMode to
false to disable this message):
 
 

  



--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



[s2] Radio buttons example

2006-12-07 Thread Mark Shifman

Hi:
The Struts 2 Documentation pages seem to have left out radio buttons:
http://struts.apache.org/2.x/docs/tag-reference.html
http://struts.apache.org/2.x/docs/ui-tag-reference.html

There is a page but its example is a little opaque:
http://struts.apache.org/2.x/docs/radio.html

I couldn't find an example either in the mailreader or in the showcase 
examples.

Any help would be appreciated.

Thanks
mas

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



[s2] Making LazyDynaBean work with ModelDriven interface

2006-12-05 Thread Mark Shifman
Some folks may be as pig-headed as me or may need to use LazyDynaBeans 
as they are translating
from struts1 to struts2.  After fooling around, I figured it out but it 
is pretty clear to me this is not the way to go.

Below is a simple example.

public final class MyAction extends ActionSupport implements ModelDriven{

   private LazyDynaBean f = new LazyDynaBean();
   public String execute() throws Exception  {
  
   String[] text_field = (String[])f.get(text_field);
   //do something with the text_field that came from LazyDynaBean 
as a String array

  return SUCCESS;
   }
  
  public Object getModel(){

   return f;
   }
}

s:form action=MyAction
   s:textfield name=map.text_field /
   s:submit /
/s:form

validators
   field name=map.text_field
   field-validator type=required
   messageText Field is required./message
   /field-validator
   /field
/validators

There were 2 things that bit me:
1.  You have to get the field name  from map.text field so that 
s:textfield can get it from the map on the valuestack and
2.  The textfield seems to get a String[] rather than a String and I 
don't have any idea how to do it differently.


mas



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



[s2] LazyDynaBean and ModelDriven interface

2006-12-04 Thread Mark Shifman
Does anybody have an example of using a LazyDynaBean with the 
ModelDriven interface?
http://struts.apache.org/2.x/docs/struts-1-solutions.html implies that 
it should work.


I have a simple action:
public final class MyAction extends ActionSupport implements ModelDriven{
   private LazyDynaBean f;
   public String execute() throws Exception  {
   String my_field = (String)f.get(my_field);
  LOG.fatal(my_myfield); //nothing here :-(
  return SUCCESS;
   }
  
   public Object getModel() {

   return f = new LazyDynaBean();
   }
}

I don't get anything from the LazyDynaBean. 


If I use a simple pojo like
public class myBean {
String my_field;
public String getMy_field() {
   return my_field;
   }

   public void setMy_field(String my_field) {
   this.my_field= my_field
   }

Things work.

What am I missing or doing wrong?
Thanks in advance
mas

--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



Re: [s2] LazyDynaBean and ModelDriven interface

2006-12-04 Thread Mark Shifman

Mark Shifman wrote:
Does anybody have an example of using a LazyDynaBean with the 
ModelDriven interface?
http://struts.apache.org/2.x/docs/struts-1-solutions.html implies that 
it should work.


I have a simple action:
public final class MyAction extends ActionSupport implements ModelDriven{
   private LazyDynaBean f;
   public String execute() throws Exception  {
   String my_field = (String)f.get(my_field);
  LOG.fatal(my_myfield); //nothing here :-(

Opps I made a typo for this example should be:
LOG.fatal(my_field);

  return SUCCESS;
   }
 public Object getModel() {
   return f = new LazyDynaBean();
   }
}

I don't get anything from the LazyDynaBean.
If I use a simple pojo like
public class myBean {
String my_field;
public String getMy_field() {
   return my_field;
   }

   public void setMy_field(String my_field) {
   this.my_field= my_field
   }

Things work.

What am I missing or doing wrong?
Thanks in advance
mas




--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



Re: Themes and templates

2006-11-28 Thread Mark Shifman

If you set
struts.ui.theme=simple in the struts.properties file
you won't fight with the templates and it will be sort of like good old 
struts 1.


However, there are other gotchas in store.  You have to get validation 
errors on the screen yourself
using s:fielderror/ since the theme cleverly puts the validation 
errors next to the invalid fields but
not with simple.  This is how I have done it but there is probably a 
better way:

s:if test=hasErrors()
   h3span style=color:red; font-weight:boldValidation 
Error/span/h3

   s:actionerror/
   s:fielderror/
/s:if
The hasErrors() comes from the value stack from you action that extended 
ActionSupport.


But this didn't really answer your question of how to make themes and 
templates work for you :(.



Juan Espinosa wrote:

Hi to all, im building an struts2 based application and i dont understan the
concept of themes an templates. In the past i used struts 1, and in the view
i used jsp tags and struts tags like iterate and others.
 
Now in the application that im buildin i use tags provided by struts like

s:action s:include s:iterator,  s:form etc. the problem started when i was
using the radio button tag that renders radio buttons based on a list. The
buttons are put side by side... and i want to put one below the other
 
label radio1 label radio2 (now)
 
label radio1

label radio2 (mi needs)
 
I want to know if render of buttons tables forms and other tags are based on

this templates..and how i could change it
 
Regards
 
Juan
 
 
 
 
 

  



--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



Re: Validation + multiple Submit buttons

2006-11-14 Thread Mark Shifman
Use a Cancel button 
http://struts.apache.org/1.x/struts-taglib/tlddoc/html/cancel.html

from javadoc
Renders an HTML input element of type submit. This tag is only valid 
when nested inside a form tag body. Pressing of this submit button 
causes the action servlet to bypass calling the associated form bean 
validate() method. The action is called normally.

see also http://wiki.apache.org/struts/StrutsUpgradeNotes128to129
mas

Andrew Martin wrote:

Hi,

I have just begun to add validation to my forms using struts validator, which 
is quite nice. I have however a problem when I have more than one submit button 
on a form.

For example I have a Save button and a Back button.
The Back button is also a submit (instead of a standard button - basically 
because we are creating a JS free applciation!)

Within the struts configuration the validate is set to true for this action 
with an input page defined.
The validation is set to check certain fields are not empty.

As both buttons call the same action the validation is called on both, but I do 
not want validation to occur on certain submit actions (namely the Back button)

Ideally I would like to configure this in the XML Struts-config.xml or 
validation.xml but I am not sure if this is actually possible (I fear the worst)

If anyone has any tips, much appreciated.

Andrew
  



--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



Re: FormFile getPath() ?

2006-09-29 Thread Mark Shifman

An action like this should do it:
public final class UploadAction extends Action {
   public ActionForward execute( ActionMapping mapping, ActionForm form,
   HttpServletRequest request, HttpServletResponse response)  
throws Exception {


   UploadForm theForm = (UploadForm) form;
   FormFile file = theForm.getTheFile();
   String fileName = file.getFileName();

   try {
   String filePath =
   tempdir + / + fileName;
   //retrieve the file data

   InputStream stream = file.getInputStream();

   //write the file to the file specified
   OutputStream bos = new FileOutputStream(filePath);
   int bytesRead = 0;
   byte[] buffer = new byte[8192];
   while ((bytesRead = stream.read(buffer, 0, 8192)) != -1) {
   bos.write(buffer, 0, bytesRead);
   }
   bos.close();
   //close the stream
   stream.close();
   } catch (Exception ex) {
 throw ex;
   }

   file.destroy();

   return (mapping.findForward(anywhereyouwant);

   }
  
Laurent Duparchy wrote:

Hi,

My front-end program upload files and then forward the file path to 
another server side program that handle them.


The problem is that I have to read the FormFile data and store it into 
another temp file.


It would increase performances this data duplication and have access 
directly to the Struts temp file.


I can't see how.

I understand that there is maybe no file at all, as a small size a 
file will be stored in memory, but is the maybe existing underlying 
FileItem avaiable in anyway ?


Laurent


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




--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



how to initialize custon-chain.config

2006-09-26 Thread Mark Shifman

HI;
I am starting to play with chains and commands in 1.3.5 and I was 
wondering where I  initialize the my custom chains ?
I don't want to mess with the request processor, just add a few command 
chains of my own.


The cookbook mail reader example from commons.chain uses a context-param 
and listener:

context-param
param-nameorg.apache.commons.chain.CONFIG_CLASS_RESOURCE/param-name
param-valueresources/catalog.xml/param-value
/context-param

listener

listener-classorg.apache.commons.chain.web.ChainListener/listener-class
/listener
The javadocs for Action servlet and Better Code With Struts 1.3 article 
http://www.infonoia.com/en/content.jsp?d=inf.05.06pr=1
say it should go as an init-param in the servlet section of the web.xml 
(from the article)

init-param
 param-namechainConfig/param-name
 param-value/WEB-INF/config/chain-config.xml,
 /WEB-INF/modules/test/inf/chainTest.xml/param-value
 /init-param
Do I need to extract the chain-config.xml from the struts-core.jar and 
include it in my WEB-INF along with my custom-chain-config.xml
or is struts smart enough to configure itself without me extracting it 
and then create my custom catalog?


Thanks in advance.
mas

[EMAIL PROTECTED]


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



Re: how to initialize custon-chain.config

2006-09-26 Thread Mark Shifman

Thanks Wendy,
I used:
init-param
param-namechainConfig/param-name
param-valueorg/apache/struts/chain/chain-config.xml,  /WEB-INF/ 
custom-chain-config..xml/param-value

/init-param

And it worked!
The first loads the struts catalog and the second load my own catalog.
Thanks again,

Mark Shifman

Wendy Smoak wrote:

On 9/26/06, Mark Shifman [EMAIL PROTECTED] wrote:

HI;
I am starting to play with chains and commands in 1.3.5 and I was
wondering where I  initialize the my custom chains ?
I don't want to mess with the request processor, just add a few command
chains of my own.

...

Do I need to extract the chain-config.xml from the struts-core.jar and
include it in my WEB-INF along with my custom-chain-config.xml
or is struts smart enough to configure itself without me extracting it
and then create my custom catalog?


Yes, Struts will find its default Chain config file inside the jar.
Even if you did need to specify it, you would not need to extract it
from the jar.

For example, you can use the provided chain config for Tiles (in an
init param for the Action servlet):
   init-param
   param-namechainConfig/param-name
   
param-valueorg/apache/struts/tiles/chain-config.xml/param-value

   /init-param
and it will be loaded from the struts-tiles.jar.

Your context param and ChainListener should work fine.

I think (but have not verified) that you can also use the chainConfig
init param for ActionServlet to load your own catalogs.  If you do
that, you'll probably have to specify the default file in addition to
your own files.  The path to the default file should be
'org/apache/struts/chain/chain-config.xml'.





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



Re: Validation on String[]

2006-09-21 Thread Mark Shifman
.
**

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

  



--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



Re: Retrieve results and display

2006-07-24 Thread Mark Shifman

There are several ways you can do this.
What you have done is made one arraylist with all the fields serially 
put into it.

You probably want to have each row as some kind of object and then put these
objects into a list.

You could your the jstl Result class which puts your result set into an
object where there results are an array of sortedmaps.  The jstl 
documentation

has examples for using this with c:foreach.

You could make each row an array and add the array to the arraylist.

You could make each row a map and add the map to the arraylist.

You could use the apache.commons.beanutils library's RowSetDynaClass.

You could use apache.commons.dbutils which has a whole bunch of handlers for
making things like a list of beans, a list of maps or a list of arrays.

Finally if you want to display the results in a table without doing all 
the dirty work

you should consider displaytag.  http://displaytag.sourceforge.net/11/


mas


Vaylee Mckenzie-Daniels (VA) wrote:

Hi

I have to display results in  jsp that is retrieves from the database.
After I retrieve the results, I place the it in an arraylist.
But I am a bit confused on how to retrieve an entire row, because I
add each field to the arraylist.

Eg. String name = rs.getString(1); //value = myname
Arraylist.add(name);

String surname = rs.getString(2); //value=mysurname
Arraylist.add(surname);

When I retrieve the results they are displayed:

Myname
Myname
Anothername
Anothersurname
AThirdName
AThirdSurname


I am using c:foreach / in the jsp page.
Please help!



~~
This e-mail and its contents are subject to the Telkom SA Limited
e-mail legal notice available at
http://www.telkom.co.za/TelkomEMailLegalNotice.PDF
~~
  



--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



Re: upgrading from struts version 1.2.6 to 1.2.9

2006-06-27 Thread Mark Shifman

there is a wiki page:
http://wiki.apache.org/struts/StrutsUpgrade

Picha, Gayatri wrote:

Hi,
I am trying to upgrade from struts version 1.2.6 to 1.2.9, what are the
steps that needs to be done in order to do this.
 
Thanks in advance,

-Gayatri.

  



--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



[Shale] commons client side validation not picking up component name

2006-03-30 Thread Mark Shifman

Hi:
When I use the commonsValidator for required on the client side, the name of 
the component
is not being picked up and the alert says null is required. This happens with 
both h:inputText
and h:selectOneListbox, the only two I have tried.

h:inputText id=s_id  size=16 value=#{su_menu.s_id}
s:commonsValidator type=required server=true client=true /
/h:inputText
...
function required() { 
this[0] = new Array(su_menu:pi, null is required., new Function(x, return {}[x];));

}

The server side validation works fine.
I have added the onsubmit and validatorScript as suggested in the web page.

Am I missing something obvious, like some library?
Thanks in advance.

mas


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



Re: [Shale] commons client side validation not picking up component name

2006-03-30 Thread Mark Shifman

Thanks Gary:
I am now getting a much more insidious exception thrown.
I using the following:

h:inputText id=s_id  size=16 value=#{su_menu.s_id}
   s:commonsValidator type=required server=true client=true 
arg=#{msgs.validate_s_id}/
   s:commonsValidator type=float server=true client=true  
arg=#{msgs.validate_s_id} /

/h:inputText
I now get when I submit a float.

java.lang.NullPointerException
   at 
org.apache.shale.validator.CommonsValidator.validate(CommonsValidator.java:525)
   at 
javax.faces.component._ComponentUtils.callValidators(_ComponentUtils.java:133)

   at javax.faces.component.UIInput.validateValue(UIInput.java:254)
   at javax.faces.component.UIInput.validate(UIInput.java:269)
   at javax.faces.component.UIInput.processValidators(UIInput.java:144)
   at 
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:417)

   at javax.faces.component.UIForm.processValidators(UIForm.java:68)
   at 
javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:417)
   at 
javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:142)
   at 
org.apache.myfaces.lifecycle.LifecycleImpl.processValidations(LifecycleImpl.java:240)
   at 
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)

   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
   at 
org.apache.shale.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:285)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
   at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
   at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
   at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
   at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184)
   at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
   at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
   at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
   at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
   at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)

   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
   at 
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
   at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
   at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:732)
   at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
   at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688)

   at java.lang.Thread.run(Thread.java:534)

I get this error with both the old commons-validator shiped with the 
blank application and

with commons-validator-1.3.0
thanks in advance.
mas

Gary VanMatre wrote:
From: Mark Shifman [EMAIL PROTECTED] 



  
Hi: 
When I use the commonsValidator for required on the client side, the name of the 
component 
is not being picked up and the alert says null is required. This happens with 
both h:inputText 
and h:selectOneListbox, the only two I have tried. 


h:inputText id=s_id  size=16 value=#{su_menu.s_id}
s:commonsValidator type=required server=true client=true /
/h:inputText
...
function required() { 
this[0] = new Array(su_menu:pi, null is required., new Function(x, return 
{}[x];));

}




You are missing the arg attribute containing the description of the field.

h:inputText id=s_id  size=16 value=#{su_menu.s_id}
 s:commonsValidator type=required server=true client=true 
   arg=My Field Name /

/h:inputText


Gary

  
The server side validation works fine. 
I have added the onsubmit and validatorScript as suggested in the web page. 

Am I missing something obvious, like some library? 
Thanks in advance. 

mas

Re: [Shale] commons client side validation not picking up component name

2006-03-30 Thread Mark Shifman

Thanks!!
I will submit a bug ticket tomorrow.
Looking at the validator-rules.xml it looks like a double validator has 
been completely omitted.


mas

Gary VanMatre wrote:
From: Mark Shifman [EMAIL PROTECTED] 

Thanks Gary: 
I am now getting a much more insidious exception thrown. 
I using the following: 


h:inputText id=s_id  size=16 value=#{su_menu.s_id}
   s:commonsValidator type=required server=true client=true 
arg=#{msgs.validate_s_id}/
   s:commonsValidator type=float server=true client=true  
arg=#{msgs.validate_s_id} /
/h:inputText

java.lang.NullPointerException
   at 
org.apache.shale.validator.CommonsValidator.validate(CommonsValidator.java:525)




This is a bug in the validator-rules.xml.  The formal parameter of the isDouble 
method
defines the parameter type as a double but it's actually a String.  


The validator entry should be:

  validator name=float
classname=org.apache.commons.validator.GenericValidator
   method=isDouble
 methodParams=java.lang.String
  depends=
  msg=errors.float
   jsFunctionName=FloatValidations

Please submit this as a bugzilla ticket but I have a workaround.

The default validation-rules.xml is packaged in with the shale-core.jar but you can override 
this by a parameter in the web.xml.


 context-param
param-nameorg.apache.shale.validator.VALIDATOR_RULES/param-name
param-value/WEB-INF/validator-rules.xml/param-value
  /context-param

Copy down the validator-rules.xml into your WEB-INF and change the methodParams
to match the fragment above.

http://svn.apache.org/viewcvs.cgi/struts/shale/trunk/core-library/src/conf/validator-rules.xml?view=markup


Gary

  

--
Mark Shifman MD. Ph.D. 
Yale Center for Medical Informatics 
Phone (203)737-5219 
[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: [Shale] where to put the jsp pages and shale-blank app

2006-03-23 Thread Mark Shifman

Thanks for the information on disallowing direct access via chain-config!

I couldn't find any exceptions that were thrown while trying to access 
WEB-INF$pages$welcome.



Craig McClanahan wrote:

I suspect an exception (due to not being able to directly access things
under /WEB-INF) is getting swallowed somewhere ... were there any exceptions
in the server logs?  If not, I'll need to investigate why this scenario is
not being reported correctly.
  
One way to protect against direct access to JSP pages is to define a

security-constraint element that protects them.  Another is to use Shale's
filtering capabilities.  There is an example of this in the /WEB-INF/chain-
config.xml file of the Shale Use Cases example app.  Note the section that
starts with the comment Disallow direct access to JSP and JSF resources.
If you set up something like this inside the preprocess command of your
own chain-config.xml file, Shale will disallow access to any resource whose
context-relative path matches one of the specified regular expressions.

Craig

  



Mark


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



[Shale]shale-blank time is 5 hours off

2006-03-22 Thread Mark Shifman
I compiled a war with the shale-blank stuff and deployed it and a weird 
thing happened, the time was 5 hours fast (minutes seemed ok)
I downloaded and deployed shale-blank-20060316.war and 
shale-blank-20060322.war and they both did the same thing.


Since the welcome.jsp doesn't do anything fancy except
f:convertDateTimetype=both/

I am baffled.  Am I somehow configured wrong? Is there something funny 
about f:convertDateTime in myfaces?


Thanks in advance.
mas

--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



Re: [Shale]shale-blank time is 5 hours off

2006-03-22 Thread Mark Shifman
Mea Culpa.  I guess the default timezone is GMT. Setting the zone to 
EST, did the correct thing.


Mark Shifman wrote:
I compiled a war with the shale-blank stuff and deployed it and a 
weird thing happened, the time was 5 hours fast (minutes seemed ok)
I downloaded and deployed shale-blank-20060316.war and 
shale-blank-20060322.war and they both did the same thing.


Since the welcome.jsp doesn't do anything fancy except
f:convertDateTimetype=both/

I am baffled.  Am I somehow configured wrong? Is there something funny 
about f:convertDateTime in myfaces?


Thanks in advance.
mas




--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



[Shale] where to put the jsp pages and shale-blank app

2006-03-22 Thread Mark Shifman

I have been playing with the shale-blank app and I have a problem.

How do you deal with putting your jsp pages under WEB-INF ie in 
WEB-INF/pages?

(presumably this is a more secure place to put your jsp pages)

Everything works fine if I move the welcome.jsp into pages/welcome.jsp 
at the web app level

and define the managed bean as:
managed-bean
   managed-bean-namepages$welcome/managed-bean-name
   
managed-bean-classorg.apache.shale.blank.WelcomeBean/managed-bean-class

   managed-bean-scoperequest/managed-bean-scope
 /managed-bean

When I move welcome.jsp to WEB-INF/pages and define the managed bean as
 managed-bean
   managed-bean-nameWEB-INF$pages$welcome/managed-bean-name
   
managed-bean-classorg.apache.shale.blank.WelcomeBean/managed-bean-class

   managed-bean-scoperequest/managed-bean-scope
 /managed-bean

and change the index.jsp to
jsp:forward page=/WEB-INF/pages/welcome.faces/

and outputing in welcome.jsp with
h:outputText value=#{WEB-INF$pages$welcome.timestamp} ...

I get The current date and time is: Dec 31, 1969 7:00:00 PM EST

if I look at the attributes in requestScope I see
WEB-INF$pages$welcomeWed Mar 22 14:52:01 EST 2006
Which is what it should be.

What am I missing?  Why isn't the page picking up the correct timestamp from
the welcome bean?

--
Mark Shifman 



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



[Shale] shale-mailreader could not be started

2006-03-16 Thread Mark Shifman

Hi :
Today I got  the shale-mailreader-20060316.war, dropped it into  my  
webapps dir, went to the tomcat manager and
it wasn't running.  I tried to start it and was told Message:  FAIL 
- Application at context path /shale-mailreader-20060316 could not be 
started


I am using Apache Tomcat/5.0.19and JVM version 1.4.2_02-b03.

I also get this error:
2006-03-16 15:29:03 StandardContext[/shale-mailreader-20060316]Exception 
starting filter shale
java.lang.UnsupportedClassVersionError: 
org/apache/shale/tiger/faces/LifecycleListener (Unsupported major.minor 
version 49.0)



The shale-usecases-20060316.war seems to be running fine.  So are does 
simple.war from myfaces.

Another example jsf-crud.war also seems to be ok.

What am I missing/doing wrong.
thanks in advance
mas

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



Re: global exception handler sometimes gets a null exception

2006-02-02 Thread Mark Shifman
What I do is log the exception and the stack trace and then let the 
super do the rest.
Since I was getting null comming up on the error page, I check the 
exception message and if it is null
I at least show the name of the exception class name on the error page 
(probably not too pretty but..)


The log with the stack trace should give you all the stuff you are 
looking for.

mas


public class YPEDExceptionHandler extends ExceptionHandler {
   private static final Log log = 
LogFactory.getLog(YPEDExceptionHandler.class);


public ActionForward execute(Exception ex, ExceptionConfig ae,
   ActionMapping mapping, ActionForm formInstance,
   HttpServletRequest request, HttpServletResponse response)
   throws ServletException {
//log the user and the stack trace then pass on to the default 
exceptionHandler   
HttpSession session = request.getSession();
MySessionCleanerBean user_bean = (MySessionCleanerBean) 
session.getAttribute(user_bean);

if(user_bean != null){
log.fatal(user: + user_bean.getUser_name() +  logon_id: + 
user_bean.getLogon_id(),ex);

}else {
log.fatal(no user_bean in session, ex);
}
if(ex.getMessage() == null){
return super.execute(new 
YPEDException(ex.getClass().getName(),ex), ae, mapping, formInstance, 
request, response);

}

   return super.execute(ex, ae, mapping, formInstance, request, 
response);

   }


Michael Davis wrote:


Hello,

I'm working on a struts application which has just been deployed and is
being used by a large number of users. I've got an error handler set up
using the global-exceptions tag. It sends me an email whenever it
catches an exception.

My config looks like this:

global-exceptions
exception type=java.lang.Throwable
   key=error.error
   path=/err100.do/
/global-exceptions

And my code does this:

Throwable e = (Throwable) request.getAttribute( Globals.EXCEPTION_KEY );

(remember that Globals.EXCEPTION_KEY is
org.apache.struts.action.EXCEPTION).

Now my problem is that about half the time, e is null, so I can't
determine where the exception happened or even what it is.

Somehow struts is able to invoke my error handler, but sometimes does it
without setting Globals.EXCEPTION_KEY in the request. When does that
happen? How can I figure out what caused the error to happen?

thanks very much,
Michael from Ottawa






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

 




--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


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



Re: Managing exceptions

2005-04-25 Thread Mark Shifman
I am using struts 1.2.6 and I tried what Joe Germuska said however I am 
missing something.
The message shows up so that html:errors/ displays it.

Or to put it another way
html:messages id=message message=false
   font color=red${message}/fontBR
/html:messages
displays it while
html:messages id=message message=true
   font color=red${message}/fontBR
/html:messages
doesn't.  So it looks like the exception is generating an ActionErrors 
object.

I generated an sql error for testing which throws a RuntimeException.
What am I missing??
mas

Joe Germuska wrote:
At 3:11 PM +0200 4/24/05, Sébastien GALLET wrote:
Hello,
I'm looking for a good way to manage exceptions in struts.
Any links in your bookmarks ?

That's a pretty general question!
I usually start by having a single global exception handler defined 
which catches anything thrown by Struts:

global-exceptions
exception
key=GlobalExceptionHandler.default
type=java.lang.Exception
path=/ErrorPage.jsp
handler=org.apache.struts.action.ExceptionHandler
/
/global-exceptions
This ensures that any exceptions get handled by my app instead of the 
servlet container.  The value for key points to a message key in 
your message resources; mine usually says something like An 
unexpected error occurred.

When it catches exceptions, he default Struts ExceptionHandler (as 
configured above) does three things:

* Puts the exception into the request scope under they key 
org.apache.struts.action.EXCEPTION
* puts an ActionMessages object into the request scope (by default) or 
the session scope (if the scope attribute of exception is set to 
session).  This ActionMessages contains a single ActionMessage which 
is created in one of two ways:
- If the caught exception extends o.a.s.util.ModuleException, that 
type's getActionMessage method is called
- otherwise, a new ActionMessage is created using the key 
attribute of the exception config and passing the exception in as 
the single
* Forwards control to a view renderer in one of two ways:
- If the path attribute of exception is specified, the forward 
goes there
- otherwise, the input forward for the current request is used.

and forwards control to the path specified in the exception-config 
(above, /ErrorPage.jsp)  If the Exception which is caught extends 
org.apache.struts.util.ModuleException, then that class's 
getActionMessage method is used to populate the ActionMessages which 
is going into the request; otherwise, the key from the 
exception-config mapping is used to create a new ActionMessage, and 
the thrown exception is included as a message format argument.

So, this basic approach covers at least a way to present users with a 
page which looks like it belongs in your application, as opposed to a 
generic container error page; then if you want to provide multiple 
mappings (either global or per-action-mapping), you can refine this 
general strategy.  You can also extend ExceptionHandler and introduce 
your own error logging behavior or other specialized operations.

Hope this helps,
Joe

--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


sslext java.lang.ClassCastException in SecureRequestProcessor

2005-03-31 Thread Mark Shifman
I just started playing with sslext and I have a problem.
java.lang.ClassCastException

org.apache.struts.action.SecureRequestProcessor.processPreprocess(SecureRequestProcessor.java:102)
My first login action is supposed to use ssl but it forwards to logon 
action and a menu that doesn't need it.

from my struts config
action path=/Welcome 
className=org.apache.struts.config.SecureActionConfig
   type=org.apache.struts.actions.ForwardAction
   parameter=/WEB-INF/jsp/logon.jsp
set-property property=secure value=true/
   /action

action path=/Logon
   type=org.ycmi.prot.ypresults.actions.LogonAction 
name=LogonForm
   validate=true input=/WEB-INF/jsp/logon.jsp 
parameter=method
   forward name=to_icat_menu 
path=/WEB-INF/jsp/icat_menu.jsp /
   ...
/action

controller maxFileSize=15M 
processorClass=org.apache.struts.action.SecureRequestProcessor /

 plug-in className=org.apache.struts.action.SecurePlugIn
   set-property property=httpPort value=8080/
   set-property property=httpsPort value=8443/ 
   set-property property=enable value=true/ 
   set-property property=addSession value=true/ 
 /plug-in

I thought it would be nice to set 
className=org.apache.struts.config.SecureActionConfig on the action 
rather than
type=org.apache.struts.config.SecureActionConfig on the action-mapping 
so I wouldn't have to setting the security
property for every single action.

When I look at line 102 that gives the error I am stumped as to why 
there should be a problem with the class cast.
 mapping = (SecureActionConfig) processMapping(request, response, path);

Any ideas would be appreciated.
Mark Shifman
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to clear ActionForm before calling mapping.forward(...)???

2005-03-21 Thread Mark Shifman
You could request.removeAttribute(employeeForm)
before the forward and a new actionForm would be made on the next round.
Gaet wrote:
Hello the list!
I have an action-mapping with a forward action that recall the same action
mapping in order to display other informations.
My problem is that my form is submitted and not cleared in my
mapping.forward(editNextEmployee)!!!
How to clear my form before to call the mapping.forward?
Thanks
Example of my struts-config.xml:
action path=/employeeDetail
   type=org.mycompany.EmployeeAction
   name=employeeForm
   validate=false
   parameter=reqCode
   scope=request
   forward name=continue path=/DnaSalarieDetail.jsp/
   forward name=back path=/employeeList.do?reqCode=list/
   forward name=editNextEmployee
path=/employeeDetail.do?reqCode=edit/
/action

- Original Message - 
From: zw [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Thursday, March 17, 2005 7:33 AM
Subject: Multiple Module Config with HTML Form

 

Hi,
I faced a problem when I use the multiple module
method with HTML
Frame.
Could someone facing the same problem help
I have 2 struts-config.xml files - one is main, the
other is in the
module /web/menu ...
the one in /web/menu module looks like :
action-mappings
type=org.apache.struts.action.ActionMapping
   action path=/MyAction
type=com..actions.MyAction
name=MenuForm scope=request
validate=false
 forward name=success
module=/web/menu
path=/mainframe.jsp /
/action
   /action-mappings
I am trying to display a screen with 2 frames - the
menu page (jsp page
with Struts Tags) and the content page (dummy page
that contains just
HTML)
I have the line html:form  action=MyAction.action 
in the menu
page.
I keep having the error - Cannot retrieve mapping for
action ... as
shown below...
I have tried displaying the menu page without the
frame, my menu is
generated without error.
2005-03-17 12:16:26 StandardWrapperValve[jsp]:
Servlet.service() for
servlet jsp threw exception
javax.servlet.jsp.JspException: Cannot retrieve
mapping for action
/MyAction
at
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:723)
at
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:419)
at
org.apache.jsp.web.menu.menu_jsp._jspService(menu_jsp.java:114)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
   

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
98)
 

at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
   

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:237)
 

at
   

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:157)
 

at
   

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:214)
 

at
   

org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
 

at
   

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 

at
   

org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:198)
 

at
   

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:152)
 

at
   

org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
 

at
   

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 

at
   

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137
)
 

at
   

org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
 

at
   

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117
)
 

at
   

org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:102)
 

at
   

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 

at
   

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
 

at
   

org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
 

at
   

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 

at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
at
   

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:702)
 

at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
at
   

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:644)
 

at java.lang.Thread.run(Thread.java:534)

TIA.
__
Do 

custom validator stopped working

2005-01-27 Thread Mark Shifman
I have a very simple custom validator that checks if a select list has 1 
or more selections.
when I upgraded to struts 1.2.6 it stopped working.  I have done all the 
things in

http://wiki.apache.org/struts/StrutsUpgradeNotes11to124 ie change the 
validator dtd

I also tried using the most recent version of the validator jar 1.1.4.
I even created a validator that always returns false
   public static boolean validateRequiredMultilist(  Object bean,  
ValidatorAction va,   Field field,  ActionErrors errors,
HttpServletRequest request) {
   return false;
}

It didn't seem to do anything but empty selections got by as valid.
My validator-rule-custom.xml contains the entry
   validator name=requiredmultilist
   classname=org.ycmi.validators.MultilistValidator
   method=validateRequiredMultilist
   methodParams=java.lang.Object,
   org.apache.commons.validator.ValidatorAction,
   org.apache.commons.validator.Field,
   org.apache.struts.action.ActionErrors,
   javax.servlet.http.HttpServletRequest
   msg=errors.multilist
   /validator
The builtins seem to be working fine.
I must be missing something very fundamental/simple.
Any help would be appreciated.
mas

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


multiple struts-config.xml and validator.xml files for dealing with stories

2004-07-13 Thread Mark Shifman
Ted Husted wrote:
For a large, heavy-duty-input data-driven web application, I would recommend C. 

 

C)  [Conventional class] is NOT used, data form validation is defined within the
validation.xml and handled by struts, the Action class (or some
surrogate) then enforces all business rules.
   

I've had deep discussions with other large teams in similar circumstances, and the 
consensus has been that (C) is the most safe, sane, and simple route.
I would also recommend finely-grained DynaValidatorForms to ensure only the expected properties are captured and validated. 

Nowadays, I also use finely-grained Struts configs, so that each pageflow or story is represented by its own struts-config.xml and validator.xml. This requires a strong naming convention to be sure the members of each config overlaps, but it makes it very easy to work with each use-case or story independently. 

 

Do you have an example which uses multiple struts-config.xml  and 
validator.xml files for dealing with stories?
...

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


jsp document/xml and struts

2004-06-11 Thread Mark Shifman
I have been trying to make a jsp document work and display.  I'm using 
tomcat5 and mosiac 1.6. and struts 1.1
I have saved my document as a jspx file and have tried a variety of ways 
to add links to a stylesheet.

mosiac tells me this :
   This XML file does not appear to have any style information 
associated with it.

and displays a nice xml file that looks like it should not a web page 
for logging in.

What am I missing?
my logon.jspx is follows.
thanks
mas
html
   xmlns=http://www.w3c.org/1999/xhtml;
   xmlns:html=http://jakarta.apache.org/struts/tags-html;
   xmlns:bean=http://jakarta.apache.org/struts/tags-bean; 
   html:xhtml/
   head
   titleLogon yp_results/title
   /head
   body
   html:errors/
   html:messages id=message message=true
   font color=red
   bean:write name=message/
   /font
   br/
   /html:messages
   html:form action=/Logon focus=logonid
   center
   table border=0 width=100%
   tr
   th align=right User ID: /th
   td align=left
   html:text property=logonid size=15 
maxlength=15/
   /td
   /tr
   tr
   th align=right Password: /th
   td align=left
   html:password property=password size=15 
maxlength=15
   redisplay=false/
   /td
   /tr
   tr
   td align=right
   html:submit property=submit  Submit 
/html:submit
   /td
   td align=left
   html:reset  Reset /html:reset
   /td
   /tr
   /table
   /center
   /html:form
   /body
/html


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


Re: [SOLVED] Default methodName for DispatchAction

2004-06-02 Thread Mark Shifman
You should look at the source code for the version of DispatchAction and 
LookupDispatchAction (available either from a download of src or the cvs 
repository).  Older builds just threw an exception if LDA didn't find a 
parameter for method.  You can overide the execute() but you might just 
as well write your own action. DispatchAction works differently.  Newer 
builds of struts have modified the behavior of LDA.

besides it is sort of fun to see how the things actually work.
--mas
Kamholz, Keith (corp-staff) USX wrote:
You know I was just thinking about doing /foo.do?method when I read your
post.  I stuck it in there, but that didn't work.
Then I tried /foo.do?method= and /foo.do?method=label.modelBrowse and
/foo.do?method=model.  Now it executes the 'unspecified' method no matter
what I do, even if I click on one of the buttons...
- Keith
-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 02, 2004 11:21 AM
To: Struts Users Mailing List
Subject: Re: [SOLVED] Default methodName for DispatchAction
With the stable release of 1.1 you need to pass the parameter through
usually
/foo.do?method=save
but to get the unspecified method running
/foo.do?method
suck it n see.
On 2 Jun 2004, at 17:07, Kamholz, Keith (corp-staff) USX wrote:
 

Yeah, I have basically that code for the submit buttons.
Isn't the 'unspecified' method of the LookupDispatchAction used to  
handle
this issue though?  I thought that's exactly what it's purpose was,  
but the
method is not getting executed as I expected it to.
Very frustrating...

- Keith

-Original Message-
From: Nicholas L Mohler [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 02, 2004 10:37 AM
To: Struts Users Mailing List
Subject: RE: [SOLVED] Default methodName for DispatchAction



Most likely the browseType parameter is not defined in you page, so  
it is
not submitted.

If you're using the struts submit buttons, you probably have something  
to
the effect of:
html:submit property=browseType
   beanMessage key=someKeyName/
/html:submit

The effect of the button tag is that when it is clicked, the  
browseType
parameter will be added into the request.  When the button is not  
clicked,
the browseType parameter is not added into the request.  If I  
remember
correctly, we had to implement a handler to listen for the enter key to
make sure that our parameter was added to the request.

Nick

|-+
| |   Kamholz, Keith  |
| |   (corp-staff) USX|
| |   [EMAIL PROTECTED]|
| |   m   |
| ||
| |   06/02/2004 10:00 |
| |   AM   |
| |   Please respond to|
| |   Struts Users|
| |   Mailing List|
| ||
|-+
   

-- 
-
 

---|
 |
|
 |   To:   'Struts Users Mailing List'  
[EMAIL PROTECTED]
|
 |   cc:
|
 |   Subject:  RE: [SOLVED] Default methodName for DispatchAction
|

   

-- 
-
 

---|

Hm
It's not working for me.  I have a form with 4 different submit  
buttons.
I'm trying to get it to execute the 'unspecified' method of my
LookupDispatchAction when the user presses 'Enter' rather than  
clicking on
a
button.

Right now I have:
public ActionForward unspecified(ActionMapping mapping, ActionForm  
form,
HttpServletRequest request,
HttpServletResponse
response)
throws Exception
{
System.out.println();
System.out.println('Unspecified' Method executing...);
System.out.println();
return modelBrowse(mapping, form, request, response);
}

But when I press 'Enter' after filling in the form, my output doesn't  
get
written to the console and I get an error that says:
javax.servlet.ServletException: Request[/Browse] does not contain  
handler
parameter named browseType

Does anyone know what I'm doing wrong or how to fix this?  It works  
fine
when I click on a button, but not when I press 'Enter'.
Thanks!


- Keith

-Original Message-
From: Kunal H. Parikh [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 01, 2004 10:11 PM
To: 'Struts Users Mailing List'
Subject: RE: [SOLVED] Default methodName for DispatchAction
Hi All!
Just went through the source code.
This problem can be attacked by overriding the method unspecified(...)
===
public ActionForward unspecified(
   ActionMapping mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
   throws Exception {