Re: Emails

2002-12-05 Thread Danny Mui
You can use the javamail package,

a nice article with some sample code.

http://www.javaworld.com/javaworld/jw-10-2001/jw-1026-javamail.html

Or you can do a search on http://java.sun.com for javamail

danny

Wendy Cameron wrote:


How do you send an email from inside a servlet using the struts framework?

Does anyone know of some sample code etc? or a good tutorial?

Regards Wendy

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

 




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




Re: Architecture question. Device Independence.

2002-10-31 Thread Danny Mui
Stxx has a version for 1.1, it's currently in CVS.  I was able to get it 
to work on my trivial examples.

Their mailing list also has a lot 1.1 tidbits as well.

danny

Darren Hill wrote:

Hi all,

Looking for some in-sight from all you experts out there.

I'm designing struts-application and what to make it 'device-independent'.
I've looked into stxx, which is exactly what I'm looking for, but its not
been upgraded to Struts 1.1.  I don't have the resources to create this for
myself, and am looking for a 'plugable' architecture to solve this problem.

Is there anything else out there that does the same thing?

Any tips I should consider?

Darren.

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





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




Re: LookupDispatchAction default value?

2002-10-31 Thread Danny Mui
Sorry to have muddled the waters too much, I assumed too much...Having 
looked at the LookupDispatchAction code, I can now make a slightly more 
educated reply ;).

Yeah I think you're going to have to workaround the parent method.


public class DefaultLookup extends LookupDispatchAction {

public ActionForward execute(.){
   if (request.getParameter(mapping.getParameter()) == null)  {

   return defaultMethod()
   } else return super.execute();
}

public abstract ActionForward defaultMethod() ;
}

This should work! i think...

danny


Wendy Smoak wrote:

Danny Mui wrote:
 

I extended the dispatch action to do something like that:
in execute() {
 ActionForward forward = null;

  if (mapping.getParameter() == null ||
   

.equals(mapping.getParameter())) {
 

  forward = executeAction(mapping, form, request, response);
  } else {
  forward = super.dispatchMethod(mapping,form,request,response,
   

mapping.getParameter());
 

  }
  return forward;
}
i'm a little weirder, i like to declaratively tell my action which to 
execute.  so extending the if statement to look at the request/form is 
possible.
this may not be lookupdispatchaction but close enough i guess?
   


I don't quite understand where this code lives.  Is this in a class that
extends Action?  Or have you subclassed LookupDispatchAction and fixed
the execute() method?

 





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




Mozilla Image Button Submit Caveat

2002-10-31 Thread Danny Mui
Just a note for people that may run up to this in the future.

when using an html:image tag such as:

html:image property=someImage value=value .. /

under mozilla 1.2, this will generate the following properties to be fed 
to BeanUtils:

someImage.x
someImage.y
someImage

If you're using a bean to capture the x, y values calling the 
someImage property will yield a IllegalArgumentException: |

argument type mismatch.

|||
|

Remove value from the image tag and you're golden once again.


|||



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



Re: html:options ordering

2002-10-30 Thread Danny Mui
Hash Tables don't guarantee order when you pull them out enmasse. 
probably best bet is to store it in a list and sort accordingly 
(Collections.sort).


Dennis Muhlestein wrote:

I have a hashtable with key/value that get displayed by an html:options
tag.  

Works ok, but they are ordered in reverse order of the id.  That isn't
any performance problem, but it looks a little strange to the user.

For instance, what if you wanted the options in alphabetical order?  In
my case, I need them ordered by the key for each options.

Any Suggestions?
TIA
-Dennis


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





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




Re: LookupDispatchAction default value?

2002-10-30 Thread Danny Mui
I extended the dispatch action to do something like that:

in execute() {

 ActionForward forward = null;
  
   if (mapping.getParameter() == null || 
.equals(mapping.getParameter())) {
   forward = executeAction(mapping, form, request, response);
   } else {
   forward = 
super.dispatchMethod(mapping,form,request,response, mapping.getParameter());
   }
   return forward;
}

i'm a little weirder, i like to declaratively tell my action which to 
execute.  so extending the if statement to look at the request/form is 
possible.

this may not be lookupdispatchaction but close enough i guess?

well hth

Wendy Smoak wrote:

I'm using LookupDispatchAction, which uses the 'action' request parameter to
call the appropriate method.

However, when the 'action' parameter is missing from the request, it dies as
expected:
javax.servlet.ServletException: Request[/processContact] does not contain
handler parameter named action

Is there a way to specify a default for the parameter it's supposed to
use?

If not, I was thinking of using a Filter to make sure that the request
parameter is present, and to insert it if necessary.  (Seems to me you can't
add request parameters, only attributes, but I haven't tried it yet.)

Have I missed something obvious or do you have any suggestions for handling
this situation?

Also, any advice for custom error pages?  I have a custom page for my own
DAOException class, but these are Error 500's, with different messages.
Is it possible to have a different error page for does not contain handler
parameter vs. other ServletExceptions that also show as code 500?

 





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




Re: is there a way to use Oracle JDBC Datasource

2002-10-29 Thread Danny Mui
Usually that kind of stuff I leave to the application server.  I know 
that Websphere uses oracle.jdbc.pool.OracleConnectionPoolDataSource 
successfully and places it in JNDI for me to use.  So basically, struts 
or no struts, you're going to have to figure out how to get that data 
source working since usually a datasource is extracted from JNDI.


Petit, Yannick (FR, Ext:Oxymel) wrote:

Hi,

I'm new to struts, and looking for it to decide use it or not for our new
Dev in J2ee MVC² Project.
Our most imprtant requirement is to interact with Oracle (8i) Database so
for powerfull Apps ( Large Corporate Intranet) we planned to use the Oracle
JDBC Datasource and most particularly the OracleConnectionPoolDatasource I
look in the code and all of the two ( OracleDatasource 
OracleConnectionPoolDatasource )implements javax.sql.Datasources but when I
defined my datasource in struts-config.xml :

data-sources
   data-source key=poolOracle
type=oracle.jdbc.pool.OracleConnectionPoolDataSource
   set-property property=autoCommit value=false /
   set-property property=driver
value=oracle.jdbc.driver.OracleDriver /
   set-property property=user value= /
   set-property property=password value=xxx /
   set-property property=url
value=jdbc:oracle:thin:XXX:1521:XXX /
   set-property property=description value=Prest_DSI /
   set-property property=readOnly value=false /
   set-property property=inactivity-timeout value=30 /
   set-property property=maxCount value=10 /
   set-property property=minCount value=2/
   /data-source
   /data-sources

And Still get the same message when I running it in my web server:

java.lang.ClassCastException:
oracle.jdbc.pool.OracleConnectionPoolDataSource 	at
org.apache.struts.action.ActionServlet.initApplicationDataSources(ActionServ
let.java:936) 	at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:457) 	at
javax.servlet.GenericServlet.init(GenericServlet.java:258) 	at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:91
6) 	at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:808)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3266) 	at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3395)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:614) 	at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123) 	at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343) 	at
org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
at org.apache.catalina.startup.Catalina.start(Catalina.java:781) 	at
org.apache.catalina.startup.Catalina.execute(Catalina.java:681) 	at
org.apache.catalina.startup.Catalina.process(Catalina.java:179) 	at
java.lang.reflect.Method.invoke(Native Method) 	at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243) [ERROR]
ActionServlet - -Initializing application data source poolOracle
java.lang.ClassCastException:
oracle.jdbc.pool.OracleConnectionPoolDataSourceStandardWrapper[/GEST_Presta
tion:action]: Marking servlet action as unavailable
StandardContext[/GEST_Prestation]: Servlet /GEST_Prestation threw load()
exception: javax.servlet.UnavailableException: Initializing application data
source poolOracle javax.servlet.UnavailableException: Initializing
application data source poolOracle 	at
org.apache.struts.action.ActionServlet.initApplicationDataSources(ActionServ
let.java:946)  	at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:457) 	at
javax.servlet.GenericServlet.init(GenericServlet.java:258) 	at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:91
6) 	at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:808)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3266) 	at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3395)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:614) 	at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123) 	at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343) 	at
org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
at org.apache.catalina.startup.Catalina.start(Catalina.java:781) 	at
org.apache.catalina.startup.Catalina.execute(Catalina.java:681) 	at
org.apache.catalina.startup.Catalina.process(Catalina.java:179) 	at
java.lang.reflect.Method.invoke(Native Method) 	at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243) 

So Ireally need help if someone can or no How to do that.

Thanks 'lot

Yannick

--
To 

Re: Struts 1.1b2, IBM Websphere 4.0

2002-10-23 Thread Danny Mui
I'm running a nightly build on Websphere (sometime after B2) 4.03 
without too many problems.  Why did you recompile all the jars?  They 
worked out of the box for me,  I just had to make sure xalan/xerces was 
in the WEB-INF/lib directory.  I had ClassCastExceptions when I had jdk 
1.4 compiled action classes and the such.

sorry couldnt be of more assistance.

danny

Sullivan, Sean C - MLG wrote:

I'm having some trouble deploying Struts 1.1b2 on IBM Websphere 4.0 

I am using Websphere 4.0 on Windows 2000 

I recompiled everything using IBM's 1.3.0 VM (the came with websphere) and
also the j2ee.jar library that came with Websphere 4.

Still I get a ClassCastException when hitting the first JSP page. Looks like
I might try recompiling Struts 
(taglibs are throwing the exception), but it's just a shot in the dark. 

java.lang.ClassCastException: org.apache.struts.taglib.tiles.UseAttributeTei

at
org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoIm
pl.java:560) 
at
org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.ja
va:489) 
at
org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:301) 
at
org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEve
ntListener.java:794) 
at
org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingList
ener.java:116) 
at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:216) 
at org.apache.jasper.compiler.Parser.parse(Parser.java:1085) 
at org.apache.jasper.compiler.Parser.parse(Parser.java:1036) 
at org.apache.jasper.compiler.Parser.parse(Parser.java:1032) 
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:236) 
at org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:677) 
at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:230) 
at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
va:247) 
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:415) 
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:544) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) 
at
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager
.java:827) 
at
com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycl
eServlet.java:159) 
at
com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServle
t.java:286) 
at
com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycle
Servlet.java:106) 
at
com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:47
2) 
at
com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletMan
ager.java:1012) 
at
com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManag
er.java:913) 
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(W
ebAppRequestDispatcher.java:499) 
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequest
Dispatcher.java:278) 
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestD
ispatcher.java:105) 
at
com.ibm.servlet.engine.webapp.SimpleFileServlet.doGet(SimpleFileServlet.java
:198) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) 
at
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager
.java:827) 
at
com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycl
eServlet.java:159) 
at
com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServle
t.java:286) 
at
com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycle
Servlet.java:106) 
at
com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:47
2) 
at
com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletMan
ager.java:1012) 
at
com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManag
er.java:913) 
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(W
ebAppRequestDispatcher.java:499) 
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequest
Dispatcher.java:278) 
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestD
ispatcher.java:105) 
at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:67)

at
com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.
java:123) 
at
com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedIn
vocation.java:67) 
at
com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequ
estProcessor.java:122) 
at
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener
.java:315) 
at
com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.ja
va:60) 
at
com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:313)

at 

Session Scope Newbie Question!

2002-10-23 Thread Danny Mui
Hi All,

I typically use Request scope forms but alas, a session form fits the 
bill.  It's so much easier to assume the form instance will disappear 
but that is not the case with session scope form beans since I want to 
keep the values.

Everytime an action declares that it uses the form bean (a dynaform 
called countryForm) such as:

action name=countryForm scope=session  

The full reset() and beanutil.populate() is called on it and all the 
values are replaced from the request and therefore overwriting 
everything!  I removed the name attribute from the actions that don't 
need to re-populate() and the jsp's using bean:write name=countryForm 
scope=session / works dandily.

My question is this, how do I use the form in actions without blowing 
away its values (from the request population) that fits into the 
Struts framework?  I've cheated in the past by pulling it out of the 
session explictly but that defeats the whole flexibility of a config file.

I look forward to hearing what I did/understood incorrectly.

Thanks.

danny


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



Re: Struts Radio Tag Example

2002-10-01 Thread Danny Mui

Check out the various links the struts crew put together:
http://jakarta.apache.org/struts/resources/index.html

Sample part of Chuck C.'s book:
http://www.theserverside.com/resources/strutsreview.jsp

My Take
Iterate over the collection and set the values accordingly.  This 
example is used when the collection contains plain strings (or the 
toString() method is overriden).  Correct/adjust if (probably) necessary:

logic:iterate name=somecollection id=someobject
html:radio name=someForm property=someFormProperty 
value=%=  someobject.toString() %  /  
/logic



Matthew Eichler wrote:

 I'm a newbie with 1.1b2 and was wondering if anyone had a simple 
 example of how to use the Struts RadioTag from the HTML tag library 
 with some sort of collection in a form bean.

 Thanks in advance.





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




Re: logging level in struts

2002-10-01 Thread Danny Mui

It really depends on which logging package you use. The commons logging
package will use JDK 1.4 logging by default and others if configured to
do so.

I use the Log4J package by dropping the jar files into the WEB-INF/lib
directory. Copy log4j.properties to WEB-INF/classes and look up the
documentation for log4j :). But if you're inpatient and want struts
(everything) to shutup, you can add the following to the properties file.

log4j.rootCategory=WARN

That means anything below WARN will be ignored. You can configure it to
make struts only stuff be quiet, but that is an exercise I leave for you!

danny


Keith Cheng wrote:

Hi,

I am using struts 1.1b2 inside Tomcat 4.1.10 and wondering how can I change the 
logging level?  It seems that the default level is [INFO], right?  Any hints?

Thanks!

Cheers,

KC



¤^¤¢¤ý¤l¡A²Ó¸ô¡A¦n¤ß¤À¤â¡AÛûÛû¨B«¢©i¤Ó­¦...
¶V800­º¦Ü·s¦ÜHit¤â¾÷¹aÁn!
Over 800 latest ringtones, only on Yahoo!

  





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




Re: Running struts app on WebSphere 4

2002-09-19 Thread Danny Mui

For me, I got class cast exceptions with StringBuffer so this may be the 
same or lead you to your solution.  The IBM JDK with Websphere is 1.2 
compliant i think? So anything compiled as 1.4 will not work.  I 
compiled with 1.3 and voila they disappeared.  But for actionservlet, I 
don't know

I have struts 1.1b application running on Websphere 4.03, you should go 
up to 03 because there are several fixes that help when deploying struts 
apps.

danny


Darren McGuinness wrote:

Hi,

Have developed a web app using the struts framework, using JBuilder and it
worked fine using TomCat4 within JBuilder.

Now I need to migrate it to a WebSphere server and I've amended the required
Websphere files/etc but I keep getting this error when starting up the
server.:

[9/18/02 16:49:45:444 GMT+01:00]   226a77 WebGroup  X Servlet
Error-[action]: Failed to load servlet: java.lang.ClassCastException:
org.apache.struts.action.ActionServlet
at
com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:148)

at
com.ibm.servlet.engine.webapp.WebAppServletManager.loadAutoLoadServlets(WebAppServletManager.java:357)

at
com.ibm.servlet.engine.webapp.WebApp.loadServletManager(WebApp.java:1010)
at com.ibm.servlet.engine.webapp.WebApp.init(WebApp.java:133)
at com.ibm.servlet.engine.srt.WebGroup.loadWebApp(WebGroup.java:234)
at com.ibm.servlet.engine.srt.WebGroup.init(WebGroup.java:139)
at
com.ibm.servlet.engine.ServletEngine.addWebApplication(ServletEngine.java:652)
at com.ibm.ws.runtime.WebContainer.install(WebContainer.java:36)
at com.ibm.ws.runtime.Server.startModule(Server.java:617)
at
com.ibm.ws.runtime.StandardServer.initializeModules(StandardServer.java:333)
at
com.ibm.ws.runtime.StandardServer.initializeRuntime0(StandardServer.java:349)
at com.ibm.ws.runtime.Server.initializeRuntime(Server.java:884)
at com.ibm.ws.runtime.StandardServer.main(StandardServer.java:519)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:158)


I'm using WebSphere 4.0.1aed, and struts 1.0

any help/advice/suggestions muchos appreciated!

Cheers


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





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




Re: I seek a sample databae crud application

2002-09-19 Thread Danny Mui

Look at Chuck C.'s (haha can't spell it)  book, it has a very nice 
sample app that uses the OJB framework (i likey!) to do the O/R mapping 
so no SQL required.

http://www.theserverside.com/resources/strutsreview.jsp
You can pre-order it now from various book vendors.  (other books are 
coming too!).  I believe Chuck provided the example app to download, 
search the archive :)

Rewrote the petstore with struts!  They use their custom DAO but the 
patterns are the same.
http://www.ibatis.com/jpetstore/jpetstore.html

For my answers:
a) umm let the container do it, get the datasource from JNDI and 
getConnection..voila!
b) thats why we get paid the big bucks!...wait nevermind...

danny

[EMAIL PROTECTED] wrote:

Does anyone have a working example of of a Struts
application that does simple CRUD routines on a
database. I'm looking for an example of how to 

a) handle the database connections (pooling)
b) process create/read/update/delete database requests

I'm not asking for someone to write one for me, just
wondering if anyone could point me to a working example
of one online that I can look at. The only one I've
seen is the one on Husted's site, the Artimus app,
which is *not* simple.. to me at least ;) All the other
sample apps I have looked at don't go into using a
database. They all save their data as xml which is not
practical for  everything (but I understand they use
xml to keep the example simple).

I have started an application for a project at work but
is going slowly and I'm not sure the way I'm doing
things is the most elegant.

Thanks in advance

__
Get your FREE personalized e-mail at http://www.canada.com

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





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




Re: Database access deployment question

2002-09-19 Thread Danny Mui

The container usually sets up a datasource for you in JNDI, for tomcat 
you modify server.xml and in resin you modify resin.conf so that's 
outside your web application.  In your web.xml file you just define the 
resource-ref... to expose to your application and all you have make 
sure is that the JNDI names match in the container definition :).

So all you need to access a DB connection is fetch it from JNDI.  For 
your other settings? You go in and modify the exploded web application 
since the container does that anyway :).

danny

Kirby Vandivort wrote:

Hello,

I have been reading up on accessing databases from within the struts
framework, and I'm not totally sure of the best way to approach the
issue of deployment.

We package up a WAR file for distribution to end users, and I would
like to be able to tell them to drop the WAR file in webapps and be
done with it.  (ie., not have to uncompress it).

However, from what I can tell, setting up clean database access
includes doing something like making a data-source entry and placing it
in the web.xml in the WEB-INF directory of the deployed application.

Since the properties for the database (username, password, etc) will be
different for each end user, I can't apriori set values for this.

So, what does everyone out there that has been down this road before do
to solve this problem?  I guess, really, this goes beyond simple
database access.  We also have a few other settings for our application
that need to be set.

CURRENTLY, we aren't using struts (pure servlets) and we have properties
files that contain this information.  But, we are currently requiring
the user to unpack the WAR file and I would love to get away from this.

Thanks for your help!

  





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




Re: java.net.MalformedURLException: unknown protocol: jndi

2002-09-19 Thread Danny Mui

Your problem looks like an XML parsing issue. Try dropping newer 
Xalan/Xerces to WEB-INF/lib (thats how i fix websphere stuff) or even 
the server's classpath.

danny

Nambiar, Sajan wrote:

Hi:

We are using struts 1.0.2 in our web application deployed on Orion
application server (version 1.4.5). We get the exception
(java.net.MalformedURLException: unknown protocol: jndi) during action
servlet's initialization. The deployment platform is HP-UX 11 and we are
using jdk 1.3. Has anyone out there faced a similar problem? Any help is
greatly appreciated.

Thanks
Sajan

p/s:
exception:

9/19/02 8:25 AM trending: org.apache.struts.action.ActionServlet:
Initializing configuration
from resource path /WEB-INF/struts-config.xml
9/19/02 8:25 AM trending: Error preloading servlet
javax.servlet.ServletException: Parsing error processing resource path
/WEB-INF/struts-config
.xml
at
org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1337)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:466)
at javax.servlet.GenericServlet.init(GenericServlet.java:232)
at com.evermind.server.http.HttpApplication.w1(JAX)
at com.evermind.server.http.HttpApplication.wj(JAX)
at com.evermind.server.http.HttpApplication.wu(JAX)
at com.evermind.server.http.HttpApplication.v4(JAX)
at com.evermind.server.http.HttpApplication.init(JAX)
at com.evermind.server.Application.ur(JAX)
at com.evermind.server.http.el.ur(JAX)
at com.evermind.server.http.ek.nm(JAX)
at com.evermind.server.http.ef.s1(JAX)
at com.evermind.server.http.ef.do(JAX)
at com.evermind.util.f.run(JAX)
Root cause is; java.net.MalformedURLException: unknown protocol: jndi
at
org.apache.struts.digester.Digester.resolveEntity(Digester.java:611)
at
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromExternalEntit
y(Defa
ultEntityHandler.java:755)
at
org.apache.xerces.readers.DefaultEntityHandler.startReadingFromExternalSubse
t(Defa
ultEntityHandler.java:571)
at
org.apache.xerces.framework.XMLDTDScanner.scanDoctypeDecl(XMLDTDScanner.java
:1139)
at
org.apache.xerces.framework.XMLDocumentScanner.scanDoctypeDecl(XMLDocumentSc
anner.
java:2145)
at
org.apache.xerces.framework.XMLDocumentScanner.access$0(XMLDocumentScanner.j
ava:21
00)
at
org.apache.xerces.framework.XMLDocumentScanner$PrologDispatcher.dispatch(XML
Docume
ntScanner.java:831)
at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.
java:3
81)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
at
org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:362)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:137)
at org.apache.struts.digester.Digester.parse(Digester.java:755)
at
org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1332)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:466)
at javax.servlet.GenericServlet.init(GenericServlet.java:232)
at com.evermind.server.http.HttpApplication.w1(JAX)
at com.evermind.server.http.HttpApplication.wj(JAX)
at com.evermind.server.http.HttpApplication.wu(JAX)
at com.evermind.server.http.HttpApplication.v4(JAX)
at com.evermind.server.http.HttpApplication.init(JAX)
at com.evermind.server.Application.ur(JAX)
at com.evermind.server.http.el.ur(JAX)
at com.evermind.server.http.ek.nm(JAX)
at com.evermind.server.http.ef.s1(JAX)
at com.evermind.server.http.ef.do(JAX)
at com.evermind.util.f.run(JAX)
9/19/02 8:25 AM trending: org.apache.struts.action.ActionServlet: Finalizing
this controller
servlet
9/19/02 8:25 AM trending: 1.4.5 Started

In our struts-config.xml we have tried the following but with no avail.
default setting
!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.0//EN
  http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;

attempt 1
!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.0//EN
 
classloader:/opt/orion/lib/struts.jar/org/apache/struts/resources/struts-co
nfig_1_0.dtd
  !--file://vision/test/test/struts-config_1_0.dtd--





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





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




Re: Using link to populate form bean

2002-09-19 Thread Danny Mui

formbeans and stuff populate from the request (either using get/posts). 
 using querystrings is simiar to a form get so beanutils.populate() 
looks for a method called setParam(...whatever datatype not too sure...) 
and puts 1, 2, or 3 into it.

So if  the action specified contains a formbean definition, the reset() 
method is called then it is populated with the request parameters, in 
this case param.

hope that helped :)

danny

Howard Miller wrote:

Hi,

How doI use a series of links to populate a form bean in Struts?

e.g., in a cgi I could do

a href=next.cgi?param=1Option1/a
a href=next.cgi?param=2Option2/a
a href=next.cgi?param=3Option3/a

and I would just have to get the value of 'param' and that would be 
that. But how do I get the value of param into a form bean, as if I'd 
done it with a form and used radio buttons.

Howard Miller


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





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




Re: html:form frustration

2002-09-19 Thread Danny Mui

Looks like you're missing a form definition, lookup (the method causing 
the exception) is looking for the form bean when no name is specified in 
the field definition.

  action path=/load
type=test.web.LoadAction
-- name=editForm 
scope=request
validate=true
  forward name=continue
   path=/jsp/edit.jsp
  /forward
/action

Hope that works!

danny

Jonathan Kovacs wrote:

Hi All,

I've been beating my head against this problem for a couple days now and
frankly, I'm stumped...

Using Struts 1.0.2, I'm attempting to display a select box which is filled
with a list of options loaded into the session context.  I've verified that
the options are loaded (using an html:iterate tag), but for some reason,
the instant I add an html:form tag to my .jsp, all hell breaks loose.  

The path my application follows is this:

/jsp/index.jsp -- /load.do -- /jsp/edit.jsp

The relevant sections of my struts-config.xml file:

struts-config

  !-- == Form Bean Definitions ===
--
  form-beans
form-bean name=editForm
   type=test.web.editForm /
  /form-beans

  !-- == Action Mapping Definitions ==
--
  action-mappings
action path=/load
type=test.web.LoadAction
scope=request
validate=true
  forward name=continue
   path=/jsp/edit.jsp
  /forward
/action
action path=/edit
type=test.web.EditAction
name=editForm
scope=request
input=/jsp/edit.jsp
validate=false
  forward name=cancel
   path=/jsp/index.jsp
  /forward
  forward name=continue
   path=/jsp/edit.jsp
  /forward
/action
  /action-mappings
/struts-config

In edit.jsp:

html:form action=/edit.do
  html:select property=name
html:options collection=%= Constants.DATA %  property=label/
  /html:select
/html:form

The error:

javax.servlet.ServletException
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:471)
at org.apache.jsp.edit$jsp._jspService(groups$jsp.java:312)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:201)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:683)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:431)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:355)
at
org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.ja
va:2199)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:2023)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:540)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:190)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
46)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at

Re: Need help with multiple submit and ActionForward

2002-09-19 Thread Danny Mui

What I've seen done before in the past is when a user clicks submit, 
disable the submit button until the response is ready.

Tokens won't really help since the output of the first request will not 
be returned back to the browser since the second takes precendence as in 
your original scenario.  Tokens will make sure only one form gets 
processed though.

Of course I could be wrong!

danny

Wangenheim, Marc wrote:

I need to prevent users from trying to submit a form multiple times
while still forwarding to a jsp after the form has been saved
successfully. Basically the user clicks on a javascript menu that calls
a javascript save function (see below). The save function sets the
struts action and submits the form. Once the form has been successfully
saved the action class forwards the user to another jsp. I have tried to
intercept all form submission but the first using a javascript global
variable. This works and prevents the user from submitting the form more
than once but unfortunatly the ActionForward never triggers leaving the
user stuck on the first jsp. Is this something I will have to handle on
the server side using tokens ?? Any help much appreciated.

-Marc

From the jsp:
html:form action=SHSMI_Save.do enctype=multipart/form-data
// save: Submits the form back to struts
function save(){
var aform = document.forms[0];
if (aform.attachment.value) {
  alert(You must click the 'Add Attachment' button to attach the file
before saving the document);
  aform.attachment.focus();
}
else {
aform.action=SHSMI_Save.do;
aform.submit();
}
}

And here's part of the struts action class:
public ActionForward perform(ActionMapping aMapping,
 ActionForm aForm,
 HttpServletRequest aRequest,
 HttpServletResponse aResponse)
 throws ServletException {
  String action = aMapping.getPath();
  if (!action.equals(/Login)  !action.equals(/LoginVerify)) {
if (aRequest.getSession().getAttribute(edHID)==null) {
  LoginBean relogin = new LoginBean();
  relogin.setError(Your session timed out. Please
re-authenticate.);
  aRequest.getSession().setAttribute(Relogin,relogin);
  ActionForward fw = new ActionForward(/Login.jsp?);
  fw.setRedirect(true);
  return fw;
}
  }
  String hid=Security.getHid(aRequest.getSession());
  Statement statement=null;
  DB database = ServletTools.createDB(getServlet().getServletContext(),
SHSMI_Const.DATABASE);
  Connection connection=database.getConnection();
  if (connection == null)
return error(aMapping,aRequest,database,statement,Unable to connect
to the database);
  statement=database.getStatement(connection);
  if (action.equals(/Login))
return
login(aMapping,aForm,aRequest,aResponse,database,statement,hid);
  if (action.equals(/LoginVerify))
return
loginVerify(aMapping,aForm,aRequest,aResponse,database,statement,hid);
  if (action.equals(/SHSMI_Delete_Temp_Attachment))
return
shsmiDeleteTempAttachment(aMapping,aForm,aRequest,aResponse,database,sta
tement,hid);
  if (action.equals(/SHSMI_Delete_Attachment))
return
shsmiDeleteAttachment(aMapping,aForm,aRequest,aResponse,database,stateme
nt,hid);
  if (action.equals(/SHSMI_Save_Attachment))
return
shsmiSaveAttachment(aMapping,aForm,aRequest,aResponse,database,statement
,hid);
  if (action.equals(/SHSMI_New))
return
shsmiNew(aMapping,aForm,aRequest,aResponse,database,statement,hid);
  if (action.equals(/SHSMI_Edit))
return
shsmiEdit(aMapping,aForm,aRequest,aResponse,database,statement,hid);
  if (action.equals(/SHSMI_Delete))
return
shsmiDelete(aMapping,aForm,aRequest,aResponse,database,statement,hid);
  if (action.equals(/SHSMI_Save))
return
shsmiSave(aMapping,aForm,aRequest,aResponse,database,statement,hid);
  if (action.equals(/SHSMI_Display))
return
shsmiDisplay(aMapping,aForm,aRequest,aResponse,database,statement,hid);
  if (action.equals(/SHSMI_Send))
return
shsmiSend(aMapping,aForm,aRequest,aResponse,database,statement,hid);
  if (action.equals(/SHSMI_Print_Main))
return
shsmiRenderMainPrintForm(aMapping,aForm,aRequest,aResponse,database,stat
ement,hid);
  if (action.equals(/SHSMI_Print_Referral))
return
shsmiRenderReferralPrintForm(aMapping,aForm,aRequest,aResponse,database,
statement,hid);
  System.out.println(Invalid ACTION: +action);
  return error(aMapping,aRequest,database,statement,Invalid ACTION);
}
} //SHSMI_Action
private ActionForward shsmiSave(final ActionMapping aMapping,
  final ActionForm aForm,
  final HttpServletRequest
aRequest,
  final HttpServletResponse
aResponse,
  final DB aDatabase,
  final Statement aStatement,
  final String aHid) {
  Table_SHSMI f = (Table_SHSMI) aForm;
  int 

Re: dynamic img src attribute

2002-09-19 Thread Danny Mui

html:img ... /
accepts a  page (context sensitive) or a src (no mucking around).

similar to the html:link / tag you can provide a map to have it 
generate the URL components for you,

Map linkMap = new HashMap();
linkMap.put(image, image222311.jpg);
linkMap.put(application, photos);

html:img page=/image.do name=someBean property=linkMapProperty /

and it will generate :

/image.do?image=image222311.jpgapplication=photos

I find that neat :)

danny

Andy Kriger wrote:

I tried asking this few days ago when my understanding of struts was
significantly less than it is now (and I didn't phrase my question very well
at that).

Here's what I'd like to do...
img src='dynamically generated path stored in a bean' /
with the constraint that I'd like to avoid the % % syntax (i want to keep
the JSP free of these things completely for the sake of the content
generating folks that don't know Java/JSP code).

Is there a struts taglib or other taglib that allows you to do something
like...
img
   param name='src' bean='myBean' property='beanProp' scope='beanScope'
/img

thx
andy



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





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




Re: html:form frustration

2002-09-19 Thread Danny Mui

Hi Jonathan,

Sorry I jumped to conclusions :).

I believe the action looker-upper ignores .do part in your action in the 
form tag but the correct syntax would be :

html:form action=/edit
/html:form

Since your action config specifies /edit your form tag should also 
specify /edit.

I think that is what is confusing the lookup.  It's looking for a 
mapping of /edit.do (that doesn't exist) where the action servlet 
disregards .do part and properly dispatches.

hth

danny


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




Re: Help on Struts's handling of initial pg request.

2002-09-19 Thread Danny Mui

Custom Registry! Chapter 5.x in the info center!

danny

Siong Chan wrote:

 Thanks Eddie..

 I'll start investigating the custom realm possiblity in Websphere.  
 Websphere is just an embellishment of Apache, so, I would assume that 
 if Apache can, so can Webspherehowever, who knows..

 Thanks again Eddie..

 Cheers!
 Siong

 At 05:01 PM 19/09/2002 -0500, you wrote:

 CMA is Container Managed Security.  It's implementation will vary 
 from container to container.  It is not tied to EJBs in any way shape 
 or form.  What it is ... is simply ... container-managed security 
 :-)  The container manages the login.

- user asks for a page with restricted access (configured in web.xml)
- server saves request
- server presents user with login page
- user submits login
- server processes login
- server replays initial request made by user

 For server processes login, the server would (depending on how you 
 configured it; different options may be available from different 
 vendors):  check a database, do a JNDI lookup (LDAP), or something 
 else.  Tomcat supports JDBC, JNDI, flat-file, and ... I think it 
 provides another one now, though what it is escapes me.

 Sounds to me like CMA may not quite work for you, unless you 
 implemented a custom realm (don't know if your container supports 
 this; Tomcat does).  You're saying that the cookie is a prompt to 
 begin a login for a specific user.  I guess it's not so bad if you're 
 not including their password; I'd try to go for a userid instead if 
 you could -- much less recognizable and identifyable.  Sorry I came 
 off like a loose cannon ;-)  I do that sometimes, but my heart is 
 in the right spot.  I just had to see people use practices that might 
 cause (even more) people to disable cookies out of paranoia.

 CMA != EJB
 CMA != Full-Fledged J2EE Server (ie JBoss)

 I believe this is a servlet specification.  Therefore, any servlet 
 container should provide you with a way to configure it.  Of course, 
 there will be as many different ways to configure it as there are 
 vendors of servlet containers :-/ ... but that's what happens when 
 you don't set a standard for something.

 Siong Chan wrote:

 Hi Eddie and Dimitar..

 Thanks for your responses.  I realise that using cookies isn't the 
 most secure thing to do, however, this is a restriction that has 
 been placed upon us from the server that is redirecting the call to us.
 However, we actually only keep the username and some other 
 information (not password) in the cookie and then our server will 
 need to perform a server to server SOAP message to authorise the 
 userid with the originating server.

 BTW, Eddie, is your CMA specifically the EJB container users/roles?
 Does the web container allow CMA?

 Dimitar...your idea to forward directly to an action worked.  Thanks!

 Cheers!
 Siong



 --
 Eddie Bush




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



 Siong H. Chan
 Systems Engineer, eBusiness Division
 MacDonald Dettwiler
 Add: 13800 Commerce Parkway, Richmond, BC, Canada V6V 2J3
 Email: [EMAIL PROTECTED]
 Voice: (604)231-2150
 Fax: (604)278-2533
 URL: http://www.mda.ca/


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





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




Re: How to include html file as banner from different site?

2002-09-12 Thread Danny Mui

See if the org.apache.struts.actions.IncludeAction can help you.  It 
uses the nifty connection classes to grab the output as string.  I think 
external sites can be used.

danny

Khan, Manuchehar A (ACF) wrote:

How can i add a html file from different web server in all views to be
included as our top banner?
Thanks

-Original Message-
From: Galbreath, Mark [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 12, 2002 11:25 AM
To: 'Struts Users Mailing List'
Subject: RE: struts 1.1b2 with Weblogic 6.1 struts 1.1b2 with Weblogic
6.1 deployment problem


It is, according to IBM, and is supposed to be addressed in SP3.

-Original Message-
From: tam [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 12, 2002 11:18 AM
To: Struts Users Mailing List
Subject: Re: struts 1.1b2 with Weblogic 6.1 struts 1.1b2 with Weblogic 6.1
deployment problem


If you are using Weblogic 6.1 SP2, try Weblogic 6.1 SP3. It seems like a
Manifest file problem

*** REPLY SEPARATOR  ***

On 2002/9/12 at ¤U¤È 04:39 EGE KARAOSMANOGLU wrote:

  

Hi,
I'm trying to use struts 1.1b2  with Weblogic 6.1 but while deploying the
application I got this error:

weblogic.j2ee.DeploymentException: Could not load esales - with nested
exception:
[java.lang.StringIndexOutOfBoundsException: String index out of range: -1]
  at


weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:431)
  

  at weblogic.j2ee.WebAppComponent.deploy(WebAppComponent.java:74)
  at weblogic.j2ee.Application.deploy(Application.java:260)
  at weblogic.j2ee.J2EEService.deployApplication(J2EEService.java:185)
  at
weblogic.management.mbeans.custom.Application.setLocalDeployed(Application.


java:362)
  

  at
weblogic.management.mbeans.custom.Application.setDeployed(Application.java:


296)
  

  at java.lang.reflect.Method.invoke(Native Method)
  at
weblogic.management.internal.DynamicMBeanImpl.invokeSetter(DynamicMBeanImpl


.java:1388)
  

  at
weblogic.management.internal.DynamicMBeanImpl.setAttribute(DynamicMBeanImpl


.java:881)
  

  at
weblogic.management.internal.DynamicMBeanImpl.setAttribute(DynamicMBeanImpl


.java:847)
  

  at
weblogic.management.internal.ConfigurationMBeanImpl.setAttribute(Configurat


ionMBeanImpl.java:295)
  

  at
com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java:13


56)
  

  at
com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java:13


31)
  

  at
weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBeans(Conf


igurationMBeanImpl.java:392)
  

  at
weblogic.management.internal.ConfigurationMBeanImpl.setAttribute(Configurat


ionMBeanImpl.java:298)
  

  at
com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java:13


56)
  

  at
com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java:13


31)
  

  at
weblogic.management.internal.MBeanProxy.setAttribute(MBeanProxy.java:322)
  at


weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:204)
  

  at $Proxy8.setDeployed(Unknown Source)
  at
weblogic.management.mbeans.custom.ApplicationManager.autoDeploy(Application


Manager.java:876)
  

  at
weblogic.management.mbeans.custom.ApplicationManager.poll(ApplicationManage


r.java:841)
  

  at
weblogic.management.mbeans.custom.ApplicationManager.poll(ApplicationManage


r.java:733)
  

  at
weblogic.management.mbeans.custom.ApplicationManager.update(ApplicationMana


ger.java:206)
  

  at
weblogic.management.mbeans.custom.ApplicationManager$ApplicationPoller.run(


ApplicationManager.java:1050)
  

What is the problem? 

Thanks
Ege


***
Bu elektronik posta ve onunla iletilen bütün dosyalar sadece göndericisi
tarafindan almas?amaçlanan yetkili gerçek ya da tüzel kisinin
kullanim?içindir.Eger söz konusu yetkili alic?degilseniz bu elektronik
postanin içerigini açiklamaniz,kopyalamaniz, yönlendirmeniz ve kullanmaniz
kesinlikle yasaktir ve bu elektronik postay?derhal silmeniz gerekmektedir
TURKCELL bu mesajin içerdigi bilgilerin dogrulugu veya eksiksiz oldugu
konusunda herhangi bir garanti vermemektedir. Bu nedenle bu bilgilerin ne
sekilde olursa olsun içeriginden, iletilmesinden, alinmasindan ve
saklanmasindan sorumlu degildir. Bu mesajdaki görüsler yalnizca gönderen
kisiye aittir ve TURKCELL'in görüslerini yansitmayabilir
Bu e-posta bilinen bütün bilgisayar virüslerine karsi taranmistir.
***
This e-mail and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they are
addressed. If you are not the intended recipient you are hereby notified
that any dissemination, forwarding, copying or use of any of the
information is strictly prohibited, 

Re: jsp and javascript

2002-08-15 Thread Danny Mui

You're going to have to iterate through the string array and print the 
javascript.

ie.

script language=javascript
//!--
var javascriptArray = new Array();

logic:iterate id=arrayItem name=array
javascriptArray.push('bean:write name=arrayItem /');
/logic:iterate
//--
/script

That should give you a hint, though it may not be perfect (never 
pretended to be!)

yanming lu wrote:

 How do we conver a String[] in jsp form to a Array in javascript?



 _
 Chat with friends online, try MSN Messenger: http://messenger.msn.com


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





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




Re: Unable to return error to jsp page

2002-08-15 Thread Danny Mui

Typically you use the html:errors / tag (thats struts 1.0x) to display 
all the errors that YOU saved in the action (saveErrors call..). There's 
a more detailed error/messaging scheme in struts 1.1 that I have yet to 
bite the bullet to learn :).

hth


Billy Ng wrote:

 Would you please tell me how did you get the errors in the Action? Is 
 there a method to call?

 Thanks!

 Billy Ng

 From: Martin Cooper [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Subject: RE: Unable to return error to jsp page
 Date: Wed, 14 Aug 2002 16:05:23 -0700



  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, August 14, 2002 1:50 PM
  To: [EMAIL PROTECTED]
  Subject: Unable to return error to jsp page
 
 
  Hi,
 
  I'm stuck... getting an error when the controller servlet is trying to
  return my error to the jsp which issued the request.

 The controller did successfully hand off to your JSP page - it was the
 execution of the page that failed. It looks like your page needs a bean
 (poInfoList) in request scope to populate it, and you didn't 
 create/store
 that in your action.

 --
 Martin Cooper


  I am
  returning the
  error directly from my Action servlet:
 
  System.out.println(Saving errors...);
  saveErrors(request,errors);
  System.out.println(Returning to:  + mapping.getInput());
  return new ActionForward(mapping.getInput());
 
 
  My action mapping:
 
  action path=/viewPODocument
  type=com.canopyint.app.rsvp.actions.PODocumentViewAction
  input=/listPOInfo.jsp
  name=poDocumentForm
  scope=request
  forward name=success path=/PODocumentView/
  /action
 
  Form beans:
 
  form-beans
  form-bean name=userProfileForm type
  =com.canopyint.app.rsvp.entity.UserProfile/
  form-bean name=poDocumentForm type
  =com.canopyint.app.rsvp.entity.PODocument/
  form-bean name=poInfoListForm type
  =com.canopyint.app.rsvp.entity.POInfo/
  /form-beans
 
  Error message:
 
  javax.servlet.jsp.JspException: Cannot find bean poInfoList in scope
  request
  at
  org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag
  .java:149)
  at org.apache.jsp._0002flistPOInfo_jsp._jspService
  (_0002flistPOInfo_jsp.java:112)
  at
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at
  org.apache.jasper.servlet.JspServlet$JspServletWrapper.service
  (JspServlet.java:201)
  at
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet
  .java:381)
  at
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:458)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at
  org.apache.catalina.core.ApplicationDispatcher.invoke(Applicat
 ionDispatcher.java:679)
  at
  org.apache.catalina.core.ApplicationDispatcher.doForward(Appli
 cationDispatcher.java:431)
  at
  org.apache.catalina.core.ApplicationDispatcher.forward(Applica
 tionDispatcher.java:355)
  at
  org.apache.struts.action.ActionServlet.processActionForward(Ac
 tionServlet.java:1758)
  at
  org.apache.struts.action.ActionServlet.process(ActionServlet.j
  ava:1595)
  at
  org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:491)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 
  Thanks for your help.
 
 
  --
  To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]



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





 _
 Join the worlds largest e-mail service with MSN Hotmail. 
 http://www.hotmail.com


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





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




Websphere / Request Dispatcher include problems (Tip)

2002-06-22 Thread Danny Mui

If you receive the problem below with Websphere, upgrade to 4.03.
Crossposting to any other WAS users that might come up against this wall.

=

This code works fine on tomcat 4.03 but that doesn't matter since
we're deploying to Websphere 4.0 :)

I'm currently using struts and in order to create an includeable
action where I can run java code before the JSP is load. Below is the
snippet of code that the kind people of apache provided and I adjusted
to fit in my app.

vitals:
windows 2000
websphere 4.02

===snip

RequestDispatcher rd =
servlet.getServletContext().getRequestDispatcher(path);

if (rd == null) {
response.sendError
(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
 messages.getMessage(include.rd, path));
return (null);
}

//prepare variables for include
this.executeAction(mapping, form, request, response);

// Forward control to the specified resource
rd.include(request, response);

===snip

the path requested: http://localhost/do/project/header
*(/do is a servlet mapping)

the jsp to be included: /project/project-header.jsp

debugging info:
the path variable in the code: /project/project-header.jsp
the request dispatcher comes out correctly, and Websphere spits out:


Error 404: JSPG0113E: JSP file
d:\WebSphere\AppServer\installedApps\pts.ear\pts-20020622.war\project\proje
ct-header.jsp\project\header
(The system cannot find the path specified) not found

I have a feeling that requestdispatcher appends the path_info to the
included url?  how can I get around this?  thanks for any help.


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




Re: Websphere 4.02 Struts Deployment

2002-06-01 Thread Danny Mui

I have a pretty complicated struts 1.1b app running on Websphere 4.02 on
Windows 2000 and have yet to see the error that you've received.

The steps I had to take to deploy to websphere were:
1) http://marc.theaimsgroup.com/?l=struts-userm=102142014616118w=2
2) Set the JVM settings for the Default Server to that mentioned below for
redirect issues

I like using theaimsgroup.com for the color scheme :)

That's pretty much all I had to go through to get my tomcat developed app to
work on websphere.

Worse case scenario, step through the code to find out what's going on.
It's a really powerful source of information that I've taken advantage of a
few times learn what the heck was going on.

Sorry!

- Original Message -
From: Benson, Mike [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Wednesday, May 29, 2002 6:44 PM
Subject: RE: Websphere 4.02 Struts Deployment



 Hello, I'm working on deploying to Websphere 4.x on the Win 2000 platform,
 and I'm receiving the following error:

 Error 500: Cannot find ActionMappings or ActionFormBeans collection

 I've read a few emails about modifying the struts code to make this work
and
 replacing parsers and all, but my dilemma is that I've got to deploy this
to
 Websphere 4.x on OS/390 when I'm done with 2000.  Is there a more simple
 solution or anyplace that describes the changes in a little more detail
that
 you can point me in the right direction?

 Thanks in advance,

 Mike Benson


  -Original Message-
  From: Danny Mui [SMTP:[EMAIL PROTECTED]]
  Sent: Wednesday, May 15, 2002 12:04 PM
  To: Struts Users Mailing List
  Subject: Re: Websphere 4.02 Struts Deployment
 
  To follow up,
 
  WebSphere 4.02 comes with the fix pack (they also have an E-FIX for
  putting
  out that fire) that makes it redirect compliant to servlet spec 2.3.  To
  enable this mode, add :
 
  name com.ibm.websphere.sendredirect.compliance
  value 1
 
  to the System Properties in the admin console under: Application Servers
  \[DefaultServer] \ JVM Settings
 
  I should have checked the Dev list :)
 
  thanks again
 
  - Original Message -
  From: Tero P Paananen [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Sent: Tuesday, May 14, 2002 7:50 PM
  Subject: RE: Websphere 4.02 Struts Deployment
 
 
I'm having problems with struts forwards:
   
logic:redirect forward=summary /
   
(forwards to /do/summary/display)
   
it actually redirects it to : /app/app/do/summary/display
   
I think Websphere is being too helpful here with the redirects!!
Any
pointers?
  
   There's a patch to this bug.
  
   I'll dig it up for you tomorrow morning, if you'd
   kindly remind me by Email.
  
   -TPP - it's past my bed time
  
   --
   To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
  
 
 
  --
  To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]

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



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




Re: Websphere 4.02 Struts Deployment

2002-05-15 Thread Danny Mui

To follow up,

WebSphere 4.02 comes with the fix pack (they also have an E-FIX for putting
out that fire) that makes it redirect compliant to servlet spec 2.3.  To
enable this mode, add :

name com.ibm.websphere.sendredirect.compliance
value 1

to the System Properties in the admin console under: Application Servers
\[DefaultServer] \ JVM Settings

I should have checked the Dev list :)

thanks again

- Original Message -
From: Tero P Paananen [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Tuesday, May 14, 2002 7:50 PM
Subject: RE: Websphere 4.02 Struts Deployment


  I'm having problems with struts forwards:
 
  logic:redirect forward=summary /
 
  (forwards to /do/summary/display)
 
  it actually redirects it to : /app/app/do/summary/display
 
  I think Websphere is being too helpful here with the redirects!!  Any
  pointers?

 There's a patch to this bug.

 I'll dig it up for you tomorrow morning, if you'd
 kindly remind me by Email.

 -TPP - it's past my bed time

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



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




Websphere 4.02 Struts Deployment

2002-05-14 Thread Danny Mui

Hello people :)

Anybody play with deploying a struts app on Websphere 4ish?  After a day's
worth of battle with the beast, I give up for the night.

*Downloaded new Xalan/Xerces binaries and placed in WEB-INF/lib to get
allow the digester to parse the struts-config.xml file correctly.

*Changed the web.xml version back to 2.2 so that the Application Installer
would stop null pointering grin.

*Learned how to regen the plugin file so that no more manual aliases need
be entered.

Thought my trek was complete but apparently not.  I've installed the app in
a different context : /app

I'm having problems with struts forwards:

logic:redirect forward=summary /

(forwards to /do/summary/display)

it actually redirects it to : /app/app/do/summary/display

I think Websphere is being too helpful here with the redirects!!  Any
pointers?  Things I'm planning to attempt:

1. Upgrade to 4.0.3...gah, server admining...
2. Patch RequestProcessor to detect double contexts...*sigh* hack..i hate
that...

As usual, everything works on my machine (Tomcat 4.0) :)

Any help appreciated!

danny



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




Re: Date fields in forms - what is the best way

2002-04-23 Thread Danny Mui

Personally I like to keep them as longs right now since the dateTime tag
library can format those in any way that is required
(http://jakarta.apache.org/taglibs/doc/datetime-doc/intro.html).  It seems
cleaner to transport them from/to html pages that way.


- Original Message -
From: Brett Porter [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Tuesday, April 23, 2002 2:51 AM
Subject: RE: Date fields in forms - what is the best way


 I can't speak authoritatively and haven't investigated Struts 1.1 yet, but
I
 keep them as strings, but modify the form setXXX function to also update
a
 private java.util.Date variable using a DateFormat. eg

 String birthDate;
 java.util.Date javaBirthDate;

 java.util.Date getJavaBirthDate() { return javaBirthDate; }
 // no setJavaBirthDate
 String getBirthDate() { return birthDate; }
 void setBirthDate( String birthDate ) {
 this.birthDate = birthDate;
 try {
 if ( birthDate != null ) {
 this.javaBirthDate = DATE_FORMAT.parse( birthDate );
 }
 else {
 this.javaBirthDate = null;
 }
 }
 catch ( ParseException e ) {
 this.javaBirthDate = null;
 }

 In validate:
 if ( javaBirthDate == null  birthDate != null ) {
 errors.add( birthDate, errors.birthDate.invalid );
 }

 Hopefully you don't have too many dates in the forms, but it does give
full
 control over the date format they are allowed to input.

 HTH,
 Brett

 -Original Message-
 From: Struts Newsgroup [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, 23 April 2002 4:40 PM
 To: [EMAIL PROTECTED]
 Subject: Date fields in forms - what is the best way


 Subject: Date fields in forms - what is the best way
 From: Lian Seng, Loh [EMAIL PROTECTED]
  ===
 I saw a post way back advising Dates be kept as Strings in the form field.

 If they are not kept as strings, what are the approaches one can take with
 date inputs ?Currently, I keep strings in the form, but transform them
 into the relevant types in the business logic.  But with xdoclet generated
 forms (Date fields are generated as Date in the form bean), this approach
 seems to be broken for me.

 In Struts 1.1, PropertyUtils seems to transform java.sql.Timestamp -
 string properly, but does that mean that the user has to enter the dates
in
 the Timestamp format ?  It seems that java.util.Date is not handled.

 Thanks for any advice
 LS


 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.349 / Virus Database: 195 - Release Date: 4/15/2002



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



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




Re: FormBean changes not recognized across actions

2002-04-19 Thread Danny Mui

I had that exact issue earlier this week.  The form is reset when passed
over to the new action(4) and repopulated from the request so that removes
all the changes.  At least that's what I convinced myself with looking over
the source.  You can do the same since it's only java ;)

I love open source!

danny

- Original Message -
From: C D [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, April 19, 2002 6:21 PM
Subject: FormBean changes not recognized across actions


 Hi,
 I am having a problem with the following flow would
 appreciate any help on it

 JSP(1) - StrutsAction(2)  
 mapping.findForward() from struts_config.xml(3)
 - Struts Action(4)

 Any properties that I set on the form bean(request
 scope) at step 2 are not reflected in the form bean at
 step 4.
 Rather the orginal values of the form bean are
 there.(the same that were there at the beginning of
 step 2)

 How do I propagate my changes to the form bean from
 the first action to the second action in the above
 scenario??
 Ofcourse, had my mapping above forwarded to a jsp
 page, then the page reflects the correct form bean
 values that I set in the first action class.

 Thanks in advance,

 CD

 __
 Do You Yahoo!?
 Yahoo! Tax Center - online filing with TurboTax
 http://taxes.yahoo.com/

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



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