Re: iterate on a value

2005-06-30 Thread David Rickard
If you don't mind mixing Struts and JSTL, use a c:forEach loop, with the 
end value being the number of children parameters;


At 11:00 AM 6/30/2005, Dewitte RĂ©mi wrote:

Hello !
In my form , i ask the number of children. On the next page, i'd like to
display as many textboxes as children to get their name.
logic:iterate provides iteration on array or collection, how can i iterate
on the number of children ?
Thanks !

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



--

David Rickard
Software Engineer

TechBooks/GTS
Your Single Source Solution!
Los Angeles CA * York, PA * Boston,MA * New Delhi, India
Visit us on the World Wide Web 
http://www.techbooks.comhttp://www.techbooks.com


[EMAIL PROTECTED]
5650 Jillson St., Los Angeles, CA 90040
(323) 888-8889 x331
(323) 888-1849 (Fax)



Apache-Tomcat Servlet Mapping Issues

2005-06-22 Thread David Rickard

System: Solaris SunOS 5.9
Apache: 2.0.52
Tomcat: 4.1.31
Mod JK: 1.2.6
The problem: Apache/mod_jk cannot resolve servlet URL mappings

When Tomcat is running stand-alone, it can resolve servlet mappings without 
any problems; so that a page with this form definition:

FORM name=login method=POST action=loginhandler
correctly invokes the com.company.LoginHandler servlet (which suggests 
there's nothing syntactically wrong with the servlet and 
servlet-mapping entries in web.xml);


When Tomcat stand-alone is turned off and Apache is turned on, that same 
page always throws a 404 error for site/loginhandler; these are the error 
messages in mod_jk.log:


[Wed Jun 22 09:04:08 2005]  [mod_jk.c (2313)]: mod_jk::jk_translate, check 
alias_dir: /usr/apache/tomcat/webapps
[Wed Jun 22 09:04:08 2005]  [mod_jk.c (2337)]: mod_jk::jk_translate, 
AutoAlias child_dir: loginhandler
[Wed Jun 22 09:04:08 2005]  [mod_jk.c (2363)]: mod_jk::jk_translate, 
AutoAlias OK for file: /usr/apache/tomcat/webapps/aiwosc/loginhandler
[Wed Jun 22 09:04:08 2005]  [jk_uri_worker_map.c (445)]: Into 
jk_uri_worker_map_t::map_uri_to_worker
[Wed Jun 22 09:04:08 2005]  [jk_uri_worker_map.c (459)]: Attempting to map 
URI '/aiwosc/loginhandler'
[Wed Jun 22 09:04:08 2005]  [jk_uri_worker_map.c (577)]: 
jk_uri_worker_map_t::map_uri_to_worker, done without a match


What terribly simple configuration error have I made here?

These are the web.xml entries for this servlet:
  servlet
servlet-nameloginhandler/servlet-name
servlet-classcom.company.aiwosc.LoginHandler/servlet-class
  /servlet
  servlet-mapping
servlet-nameloginhandler/servlet-name
url-pattern/loginhandler/url-pattern
  /servlet-mapping

This is the workers.properties file:
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=server.org
worker.ajp13.type=ajp13


This is the app section from mod_jk.conf:
 server.org:/aiwosc 

# Static files
Alias /aiwosc /var/apache/tomcat/webapps/aiwosc

Directory /var/apache/tomcat/webapps/aiwosc
Options Indexes FollowSymLinks
DirectoryIndex index.html
/Directory


# Deny direct access to WEB-INF and META-INF
#
Location /aiwosc/WEB-INF/*
AllowOverride None
deny from all
/Location

Location /aiwosc/META-INF/*
AllowOverride None
deny from all
/Location

JkMount /aiwosc/addtitleservlet  ajp13
JkMount /aiwosc/submittitleservlet  ajp13
JkMount /aiwosc/transfertitleservlet  ajp13
JkMount /aiwosc/saveoscservlet  ajp13
JkMount /aiwosc/reordercastservlet  ajp13
JkMount /aiwosc/loginhandler  ajp13
JkMount /aiwosc/editcategoryservlet  ajp13
JkMount /aiwosc/edittitleservlet  ajp13
JkMount /aiwosc/addaddendumservlet  ajp13
JkMount /aiwosc/*.jsp  ajp13
JkMount /aiwosc/addcategoryservlet  ajp13

This is the Context entry for the app in server.xml:
!-- Oscars OSC Context --
Context path=/aiwosc docBase=aiwosc debug=5
 reloadable=true crossContext=true
 Logger className=org.apache.catalina.logger.FileLogger
 prefix=aiwosc_log. suffix=.txt
 timestamp=true/

 Resource name=jdbc/oscars auth=Container
   type=javax.sql.DataSource/

  ResourceParams name=jdbc/oscars
   parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
   /parameter
   parameter
namedriverClassName/name
valueoracle.jdbc.driver.OracleDriver/value
   /parameter
   parameter
nameurl/name
valuejdbc:oracle:thin:@gtsora2.gtsgraphics.com:1521:ACAD/value
   /parameter
   parameter
nameusername/name
valueIMPC_ADMIN/value
   /parameter
   parameter
namepassword/name
valuePIRANHA/value
   /parameter
   parameter
namemaxActive/name
value20/value
   /parameter
   parameter
namemaxIdle/name
value10/value
   /parameter
   parameter
namemaxWait/name
value-1/value
   /parameter
  /ResourceParams
/Context

And these are the mod_jk load/configuration entries from httpd.conf:
IfModule !mod_jk.c
LoadModule jk_module modules/mod_jk.so
/IfModule

Include /usr/apache/tomcat/conf/auto/mod_jk.conf
JkWorkersFile /usr/apache/tomcat/conf/workers.properties
JkLogFile /usr/apache/logs/mod_jk.log
JkLogLevel debug
JkLogStampFormat [%a %b %d %H:%M:%S %Y] 
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat %w %V %T

JkAutoAlias /usr/apache/tomcat/webapps
JkMount /*.jsp ajp13
JkMount /*/servlet/ ajp13




--

David Rickard
Software Engineer

TechBooks/GTS
Your Single Source Solution!
Los Angeles CA * York, PA * Boston,MA * New Delhi, India
Visit

Re: Concurrent login detection - how?

2005-06-14 Thread David Rickard

Don't know if this is an optimum solution, but it should work:
Keep a List or Vector of IDs for active users in a shared, 
application-level object (probably ServletContext);
When someone logs in, search the List for the submitted ID: if not present, 
continue with login sequence; if present, kick them to the duplicate 
login page;
Remove IDs from the List when users log out (and add a 
ServletContextListener to catch people who leave the site without logging 
out--remove their IDs when their sessions time out);


At 09:22 AM 6/14/2005, you wrote:

What is the best way to detect two people being logged in concurrently using
the same account? This is one aspect of my efforts to restrict fraudulent
access. Again, I don't want to use Acegi since it seems to break the rest of
my app. So, what's the best way to do this 'traditionally'?

Thanks!

Michael


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




--

David Rickard
Software Engineer

TechBooks/GTS
Your Single Source Solution!
Los Angeles CA * York, PA * Boston,MA * New Delhi, India
Visit us on the World Wide Web 
http://www.techbooks.comhttp://www.techbooks.com


[EMAIL PROTECTED]
5650 Jillson St., Los Angeles, CA 90040
(323) 888-8889 x331
(323) 888-1849 (Fax)



Re: Concurrent login detection - how?

2005-06-14 Thread David Rickard
A HttpSessionListener implements a sessionDestroyed() method, which 
receives a HttpSessionEvent object from the servlet container when a 
session is about to be invalidated (the timing undoubtedly depends upon 
the container); the HttpSessionEvent object has a getSession() method, 
which returns the HttpSession object about to be invalidated, from which 
you can get the session ID  other information to identify the affected user;


At 01:28 PM 6/14/2005, Michael Mehrle wrote:
That actually goes to the heart of my question: HOW do I detect when their 
session times out? ;-)
I know the 'strategy' of doing this, but I don't know how to capture a 
timed-out session - technically. Any input would be welcome.


TIA,

Michael

- Original Message - From: David Rickard 
[EMAIL PROTECTED]

To: Tomcat Users List tomcat-user@jakarta.apache.org
Sent: Tuesday, June 14, 2005 9:53 AM
Subject: Re: Concurrent login detection - how?




Remove IDs from the List when users log out (and add a
ServletContextListener to catch people who leave the site without logging
out--remove their IDs when their sessions time out);

At 09:22 AM 6/14/2005, you wrote:

What is the best way to detect two people being logged in concurrently using
the same account? This is one aspect of my efforts to restrict fraudulent
access. Again, I don't want to use Acegi since it seems to break the rest of
my app. So, what's the best way to do this 'traditionally'?

Thanks!

Michael


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



--

David Rickard
Software Engineer

TechBooks/GTS
Your Single Source Solution!
Los Angeles CA * York, PA * Boston,MA * New Delhi, India
Visit us on the World Wide Web
http://www.techbooks.comhttp://www.techbooks.com

[EMAIL PROTECTED]
5650 Jillson St., Los Angeles, CA 90040
(323) 888-8889 x331
(323) 888-1849 (Fax)






--

David Rickard
Software Engineer

TechBooks/GTS
Your Single Source Solution!
Los Angeles CA * York, PA * Boston,MA * New Delhi, India
Visit us on the World Wide Web 
http://www.techbooks.comhttp://www.techbooks.com


[EMAIL PROTECTED]
5650 Jillson St., Los Angeles, CA 90040
(323) 888-8889 x331
(323) 888-1849 (Fax)



Tomcat Startup/Shutdown and mod_jk Issues

2005-01-18 Thread David Rickard
System: SunOS 5.9 Generic_117171-13 sun4u sparc SUNW,Sun-Fire-V440
Apache: 2.0.52
Tomcat: 5.5.4
Connector: jk-1.2.6
Java: JDK 1.5.0.01
We're attempting an upgrade from Tomcat 4.1.31 to 5.5.4; we are using JK 1 
as a connector to Apache (due to prior experience and relative simplicity);
We are encountering three issues:
1) During start-up, Tomcat throws the following error messages:

java.lang.NoSuchMethodError: 
org.apache.naming.NamingContextEnumeration.init(Ljava/util/Iterator;)V [ 
for each application it attempts to deploy]

SEVERE: Catalina.start:
LifecycleException:  Protocol handler start failed: java.net.BindException: 
Address already in use:8080
[presumably from Tomcat not releasing 8080 properly during previous 
start-up/shut-down cycles]

2) During shut-down, Tomcat throws the following error:
SEVERE: Protocol handler pause failed
java.lang.NullPointerException
at org.apache.jk.server.JkMain.pause(JkMain.java:655)
3) The mod_jk.conf file does not build; its entire contents are:
## Auto generated on Tue Jan 18 16:24:18 PST 2005##
IfModule !mod_jk.c
  LoadModule jk_module 
/usr/apache/modules/jakarta-tomcat-connectors-jk-1.2.6-solaris8-sparc-apache-2.0.43_
native.so
/IfModule

JkWorkersFile /var/apache/tomcat/conf/jk/workers.properties
JkLogFile /var/apache/tomcat/logs/mod_jk.log
JkLogLevel emerg

VirtualHost spinach.techbooks.com
ServerName spinach.techbooks.com
/VirtualHost
[presumably this is from applications not loading during start-up; but 
could it be from some other cause?]

--
David Rickard
Software Engineer
TechBooks/GTS
Your Single Source Solution!
Los Angeles CA * York, PA * Boston,MA * New Delhi, India
Visit us on the World Wide Web 
http://www.techbooks.comhttp://www.techbooks.com

[EMAIL PROTECTED]
5650 Jillson St., Los Angeles, CA 90040
(323) 888-8889 x331
(323) 888-1849 (Fax)


Tomcat Won't Shutdown

2005-01-14 Thread David Rickard


System: SunOS 5.9 Generic_117171-13 sun4u sparc SUNW,Sun-Fire-V440
Apache: 2.0.52
Tomcat: 4.1.31
Connector: jk-1.2.6
We installed Apache and Tomcat without error (built Apache from source,
loaded Tomcat from binary), and configured the connector so that they
were talking correctly (the /examples/jsp/ site comes up fine);
We experimented with an application that would use a
ServletContextListener and the Jakarta Commons/Configuration package to
load application variables t startup; the ServletContextListener by
itself worked fine--i.e., it loaded hard-coded variables into
ServletContext and they could be retrieved by JSPs, servlets
etc;
The problems started when we added Commons/Configuration to the
ServletContextListener: the application would not load, and catalina.out
listed various ClassNotFound errors for needed Jakarta Commons classes
(from digester, logging etc)--even though the jars are in
tomcat/commons/lib; so we placed the latest JARs for commons-lang,
commons-digester, commons-logging in the application WEB-INF/lib
directory; the application started loading, though the
ServletContextListener could not find the configuration files--kept
spitting out Exception caught opening stream to URL errors
(which is presumably just a file-pathing issue);
Only something has been stepped on, because Tomcat will no longer shut
down: when we execute shutdown.sh, it throws the following error:
Jan 14, 2005 4:40:43 PM org.apache.commons.digester.Digester
startElement
SEVERE: Begin event threw exception
java.lang.ClassNotFoundException:
org.apache.catalina.core.StandardServer
[full stack trace is in the attached file]
And catalina.out records the following errors when we try to execute
startup.sh:
Jan 14, 2005 4:43:03 PM org.apache.coyote.http11.Http11Protocol 
init
SEVERE: Error initializing endpoint
java.net.BindException: Address already in use:8080
Obviously, port 8080 is already in use because Tomcat hasn't released
it--because it didn't shutdown as requested; our questions are:
1) What got stepped on in Tomcat to cause this behavior?
2) Is there another way to stop Tomcat (other than system reboot), to see
if we can get it to restart gracefully?
3) Is there a way to fix Tomcat, short of re-installing it?

--
David Rickard
Software Engineer
TechBooks/GTS 
Your Single Source Solution! 
Los Angeles CA * York, PA * Boston,MA * New Delhi, India 
Visit us on the World Wide Web
http://www.techbooks.com 

[EMAIL PROTECTED] 
5650 Jillson St., Los Angeles, CA 90040 
(323) 888-8889 x331
(323) 888-1849 (Fax) 


TOMCAT SHUTDOWN STACK TRACE
Jan 14, 2005 4:40:43 PM org.apache.commons.digester.Digester startElement
SEVERE: Begin event threw exception
java.lang.ClassNotFoundException: org.apache.catalina.core.StandardServer
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at 
org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java:204)
at org.apache.commons.digester.Rule.begin(Rule.java:152)
at org.apache.commons.digester.Digester.startElement(Digester.java:1286)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown 
Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown 
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown 
Source)
at 
org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown
 Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
 Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1572)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:522)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:352)
at org.apache.catalina.startup.Catalina.process(Catalina.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:156)
Catalina.stop: java.lang.ClassNotFoundException

Tomcat Connections And Memory Usage

2004-12-03 Thread David Rickard
Apache Version: 2.0.47
Tomcat Version: 4.1.29
Connector: mod_jk
Server: SunOS 5.9 Generic_112233-07 sun4u sparc SUNW,Ultra-250
Does Tomcat have a configurable maximum number of simultaneous connections 
(ala Apache's MaxClients property)?  If so, how/where is this value 
configured?
If not, is the connection limit determined by the front-end web server? or 
by machine resource limits?
How do we determine how much memory Tomcat is using per connection?

--
David Rickard
Software Engineer
TechBooks/GTS
Your Single Source Solution!
Los Angeles CA * York, PA * Boston,MA * New Delhi, India
Visit us on the World Wide Web 
http://www.techbooks.comhttp://www.techbooks.com

[EMAIL PROTECTED]
5650 Jillson St., Los Angeles, CA 90040
(323) 888-8889 x331
(323) 888-1849 (Fax)


System Clock Issues with Webapps

2004-08-06 Thread David Rickard
Server: SunOS 5.9 Generic_112233-07 sun4u sparc SUNW,Ultra-250
Apache: 2.0.47
Tomcat: 4.1.29
Our server is used by divisions in multiple timezones, so the system clock 
is set to UTC to simplify log writing etc;
Each system user--including root--has a profile which masks the system 
clock to the appropriate time zone; root is masked to US-Pacific, the 
physical location of the server (confirmed by running date as root).
Apache and Tomcat run as root processes and should use root's profile; 
however, they sometimes bypass the profile and report UTC date/time value 
(evidenced by outputting the value of a java.util.Date in a JSP).
Doing an Apache/Tomcat restart will correct this system--so that our time 
JSP reports US-Pacific time as expected; however, Apache/Tomcat will revert 
(usually in less than a day) to reporting UTC time.
Any ideas on why this is happening? and how we can correct it?

--
David Rickard
Software Engineer
The GTS Companies
A TechBooks Company
-- 

The GTS Companies:
GTS Publishing Services, GTS Graphics, GTS Innova:
Your Single-Source Solution!
Los Angeles CA  *  York, PA  *  Boston MA  *  New Delhi, India
-- 


[EMAIL PROTECTED]
Visit us on the World Wide Web
http://www.gtscompanies.com
5650 Jillson St., Los Angeles, CA 90040
(323) 888-8889 x331
(323) 888-1849 [fax]