Re: how to read uploaded FormFile InputStream multiple times?

2003-10-02 Thread Vikram Goyal
You are better off using FileUpload from the Commons package. Using
DiskFileUpload, you can set a threshold on the size of your files. If the
threshold is breached, the files will be saved in a temp location on your
hard disk from where you can access them as many times as you want. So you
could first save them to the database and then do whatever else you want.
You could even enhance the FileUploadBase to do exactly as you want, i.e,
write to the database and then still give you a handle on a perhaps new
input stream.

--
Vikram


- Original Message - 
From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, October 03, 2003 3:11 PM
Subject: Re: how to read uploaded FormFile InputStream multiple times?


> Ralf Hauser wrote:
>
> >Hi,
> >
> >we use the  >application.
> >First we put it into the database, but immediately thereafter, we would
like
> >to send it off to multiple recipients via encrypted mail.
> >
> >We get a "Bad File Descriptor" when trying to access the data for a
second
> >time after putting it into the database.
> >doing a inputStream.reset() gives a "java.io.IOException: mark/reset not
> >supported".
> >If we wipe the attachment from the session and get it from the (MySQL)
> >database again, reset() works beautifully and we can read it many times.
But
> >going back and forth to the database is a big waste if the InputStreams
get
> >large.
> >
> >Therefore my request to enhance the documentation in
>
>http://jakarta.apache.org/struts/api/org/apache/struts/upload/FormFile.html
#
> >getInputStream(): how can one use such an InputStream multiple times?
> >
> >Many thanks for any hints!
> >
> >
> Your best bet is to assume that you cannot *ever* read the same input
> stream more than once.  There is no guarantee in the servlet spec that
> this is possible, and it would be prohibitively expensive for a
> container to make such a guarantee, so this is not really a Struts isse
> or even a commons-fileupload issue.  It's an unwarranted assumption that
> you are making -- and such assumptions are more likely than not to be
> non-portable.
>
> The only sane thing to do is to make sure that your *application* has
> stored the uploaded file data where your *application* can find it
> again.  Expecting reset() to work is pretty much guaranteed to cause
> your application to fail.
>
> Note the emphasis in the above paragraph -- this is primarily an
> application issue, not a framework issue or a container issue.
>
> > Ralf ([EMAIL PROTECTED])
> >
> >
> Craig
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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



Re: html base element

2003-09-22 Thread Vikram Goyal
Hi Ashwani,

html:base is used to let the the browser know the location of the document
currently being seen by the user. This is important in the case of web pages
where there is an internal mapping between what a browser submits an action
to and what the user ends up seeing. These two may be different and ususally
are for web pages created with Struts.

For e.g., your app1/mystruts/logon.do may actually be referring to a page in
lets say app1/mystruts/dir1/welcome.jsp. Now, if you had images in this page
and they were mapped with relative paths in a directory as
../images/image1.gif, this would imply to the browser that image1.gif needs
to be retrieved from the directory app1/images (because the browser sees the
URL as app1/mystruts/logon.do and not app1/mystruts/dir1/welcome.jsp), when
you actually mean that it should be retrieved from app1/mystruts/images.

If you specify html:base, it makes an entry in the head section which is
used by all the relative urls in your page. So for example, if you did put
an html:base in the welcome.jsp as above, it would tell the browser that the
base url for all relative urls in this page is app1/mystruts/dir1 and not
app1/mystruts.

HTH
Vikram

- Original Message - 
From: "Kalra, Ashwani" <[EMAIL PROTECTED]>
To: "Struts (E-mail)" <[EMAIL PROTECTED]>
Sent: Tuesday, September 23, 2003 4:11 PM
Subject: html base element


> Hi,
>
> I am not able to figure out what problem I face when I am not using this
> tag.  for eg. I am able to use the relative paths to the images from the
> page whose url is http://localhost:8080/mystruts/logon.do
>    on the browser. Can someone
give
> an example on this ?
>
> TIA
> Ashwani Kalra
> http://www.geocities.com/ashwani_kalra
> 
>
>
>
> 
> This message contains information that may be privileged or confidential
and
> is the property of the Cap Gemini Ernst & Young Group. It is intended only
> for the person to whom it is addressed. If you are not the intended
> recipient, you are not authorised to read, print, retain, copy,
disseminate,
> distribute, or use this message or any part thereof. If you receive this
> message in error, please notify the sender immediately and delete all
copies
> of this message.
>


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



URL Rewriting

2003-09-18 Thread Vikram Goyal
Hello all,

A curious, but not totally unexpected, thing happens when I try to access my
Apache httpd-Tomcat (4.1.24) site for the first time via mod_jk2 connector.
Since Tomcat/Struts resorts to a URL rewrite of every link (because it
doesn't know that the browser is going to accept a cookie the first time),
all the static data is also appended with the URL rewrite since I am using
the Struts  and  tags. Somehow, the browser is not
able to resolve these URL rewritten links. Does anyone know why this would
be the case? If I do a refresh of the page, the images and other data is
retrieved successfully. If I run the site directly, i.e., on port 8080 on
which Tomcat is running, the data is retrieved without any problem even in
the first go.

If I remove the  tag and replace it with  tag and in essence
take out URL rewritting from the static data, that also works fine.

Any help, pointers appreciated.

Regards,
Vikram


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



Re: [OT] RE: Stackoverflow after DB inactivity

2003-09-16 Thread Vikram Goyal
Thanks Steve for the suggestions.

Regards,
Vikram

- Original Message - 
From: "Steve Raeburn" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, September 17, 2003 3:08 PM
Subject: [OT] RE: Stackoverflow after DB inactivity


> Additional info on why MySQL autoReconnect does not work when
> autoCommit is false.
> 
> http://www.mail-archive.com/[EMAIL PROTECTED]/msg70196.html
> 
> Steve
> 
> 
> 
> -
> 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]



Stackoverflow after DB inactivity

2003-09-16 Thread Vikram Goyal
Hello all,

I am getting a Stackoverflow error in Tomcat 4.1+ after a period of database
inactivity, typically (3+ hours). I am using Struts for the front end and
while the non DB access pages work fine, as soon as access to a page is
requested where data is to be fetched from the database, I get the
StackOverflow. This is not random and I can replicate the error. The error
goes away however, when I try to access the same page twice or thrice and
everything works fine after that.

This error is appearing on both windows and linux, i.e., Tomcat is on these
machines, although the database, MySQL 4 is running on linux 9. The DB
access is through a connection pool I set up in Struts config for my
application using org.apache.commons.dbcp.BasicDataSource.

The stack trace follows:
2003-09-16 11:39:56 StandardWrapperValve[action]: Servlet.service() for
servlet action threw exception
javax.servlet.ServletException: Servlet execution threw an exception
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:269)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
 at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
 at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
 at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
 at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
 at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
 at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:392)
 at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
 at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:619)
 at java.lang.Thread.run(Thread.java:534)
- Root Cause -
java.lang.StackOverflowError

Any help, pointers appreciated.

Regards,
Vikram


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



Re: A JSP based JDBC query client?

2003-08-18 Thread Vikram Goyal
You could also use the DB Tag library from Jakarta for trivial applications:

http://jakarta.apache.org/taglibs/doc/dbtags-doc/intro.html

Regards,
Vikram


- Original Message - 
From: "David Friedman" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>; "Martin
Naskovski" <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 11:08 AM
Subject: RE: A JSP based JDBC query client?


> You can show SQL queries in a JSP using this:
> http://cocoon.apache.org/1.x/sqltaglib.html
>
> I don't happen to know if it can submit SQL,
> only that obvious that it lets you show SQL.
> Maybe you could embged a bean:write within
> the tag to pull the submitted form field to
> do that.
>
> -David
>
> -Original Message-
> From: Martin Naskovski [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 18, 2003 7:59 PM
> To: Struts Users Mailing List
> Subject: A JSP based JDBC query client?
>
>
> Does anyone know if there's a simple JSP page available to which one can
> submit SQL
> queries and just get plain rows back into as simple row format as
possible?
> Akin to using the 'mysql' command line client, except in a JSP view :).
>
> Thanks.
>
> Martin
> --
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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



Re: log4j configuration and usage

2003-08-18 Thread Vikram Goyal
Hi Viral,

This is not the log4 list. Try the log4j list or read the several articles
on how to use it.

http://jakarta.apache.org/log4j/docs/documentation.html

PS: Which PU are you in at Infy?

Regards,
Vikram

- Original Message - 
From: "Viral_Thakkar" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, August 19, 2003 3:21 PM
Subject: log4j configuration and usage


I have log4j 1.2.8 version.

Can anyone please tell me the log4j configuration required to do, for
its use for logging and how to use log4j?

Example would be better.

-
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: StackOverflow error?

2003-06-05 Thread Vikram Goyal
I get the same error when I try to execute a DB query via a form. I am using
Struts1.1rc1, Tomcat 4.1.24 and MySQL. I initially thought that the error
was because the connection was lost to the DB server and therefore I had put
autoReconnect=true in the DB URL. But that did not stop the problem.

I get the error only once when the server has been inactive overnight and if
I retry, it works fine.
Maybe thats why I have not tried to debug it too much. :)

Vikram
- Original Message - 
From: "Andrew Hill" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, June 05, 2003 2:50 PM
Subject: RE: StackOverflow error?


> You doing anything recursive?
>
> Almost every time I get a stack overflow its cos im doing something
> recursive and have somehow managed to get into an infinite loop...
>
> -Original Message-
> From: Mick Knutson [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 5 June 2003 12:38
> To: [EMAIL PROTECTED]
> Subject: StackOverflow error?
>
>
> I am getting this StackOverflow error, and can't seem to figure out
anything
> from the trace. Can someone help with this please:
>
>
> java.lang.StackOverflowError
> at
>
javax.servlet.ServletRequestWrapper.getParameterNames(ServletRequestWrapper.
> java:223)
> at
>
org.mortbay.jetty.servlet.Dispatcher$DispatcherRequest.getParameterNames(Dis
> patcher.java:328)
> at



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



Re: [OT] slackers

2003-05-30 Thread Vikram Goyal
Hey! Who are you calling a slacker mate! :) A Foster here and a Foster there
makes the world go around.

Happiling chugging on down under..
Vikram

- Original Message - 
From: "Mark Galbreath" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, May 30, 2003 11:07 AM
Subject: RE: [OT] slackers


Hey! Don't forget those slacker Aussies, drinking good beer while sending
that Fosters slime to Canada, which then forwards it down to the States.  I
thought they were our allies, but now I think it's a terrorist conspiracy to
rob all Americans of their taste for good beer.  And forget about the
Canucks...they think Molson and Labatts is good beer.  UGH!  The only thing
worse than Budweasel I can think of is Canadian beer.  Even Fosters is
better than that

Late Thursday night on second bottle of shiraz looking forward to Friday!
Mark

-Original Message-
From: Chen, Gin [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 8:50 PM
To: 'Struts Users Mailing List'
Subject: RE: [OT] slackers


i am. still at work too.
only brits are slackers

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 8:43 PM
To: 'Struts Users Mailing List'
Subject: [OT] slackers


It's 2045 EST and no one is online.   'nuf said.



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

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



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



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



Justifying Tag Libraries - Slightly long

2003-01-21 Thread Vikram Goyal
Hi all,

After failing to convince my boss otherwise about his fear of slowing down the 
performance of an internationalizated web application by the use of Struts tags, I 
decided to set up a stress test environment to prove that tags do not have that high a 
performance issue. However, much to my dismay and surprise, I found that my boss was 
correct! Tags, do indeed, affect performance, and we are not talking about nanoseconds 
of difference. Here is my test environement and how I went about doing so:

Single Client Machine: Windows XP Pro - with 512 MB RAM, Pentium 4 (1.7Mhz),  IE 5.5.
Server: Windows XP Pro running Weblogic 7.1 with 512 MB RAM, Pentium 4 (1.7 Mhz)

Stress Test Tool: Microsoft Web Application Stress Tool

Struts Version: Struts 1.1b2.

Testing method:
1. Ran 1000 threads on a simple JSP page, which used bean tags to render the content 
of the page. This is a simple page, which contains a lot of text, all of which is read 
from ApplicationResources.  This page was ideal for the test as it had the most tags 
(40+).
2. Ran 1000 threads on the same page. However, this page, is static, meaning, that the 
page accessed was pre generated using an internationlation mechanism that simply 
generates static html pages for different languages and puts them in respective i18ned 
directories. So a user who understands spanish would go to the document root for 
spanish and so on.

Well, the results:
Without boring you with all the figures, let me just put get into the result analysis. 
Overall, I found that for the first case, the difference between the time taken to get 
the first byte(ttfb) of the page and time taken to get the last byte(ttlb) of the 
page, was vast. In the second case, this difference was miniscual. This meant, that in 
the first case, the pages were received faster, but took longer to finish downloading. 
In the second case, the pages took slightly longer to come through, but finished 
downloading much much faster than the first case (150 times faster than first case).

I ran the tests three times for 25, 100 and 1000 clients and all the tests results 
gave the same analysis.

With these figures in hand, I had no answer to my boss's snide remarks about uh, hmm 
... well never mind, except to say that I had no answer.  What I am hoping from the 
list is if someone can help me understand why this would happen, would this be as 
expected and well, how do you still justify the usage of tags.

Best Regards,
Vikram Goyal


Re: redirect attribute (newbie)

2002-12-30 Thread Vikram Goyal
Search the mailing list for "chaining actions". This has been covered
several times in this list.

Regards,
Vikrma
- Original Message -
From: "Suresh Addagalla" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 30, 2002 11:01 PM
Subject: redirect attribute (newbie)


> Hi,
>
> I have a loginAction. If login is successfu, I want to perform another
> action as follows.
>
>  redirect="true"/>
>
> I am not sure whether to use true or false for "redirect". What is the
> difference and which one should I use in this case?
>
> Thanks,
> Suresh
>
>






> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: error reloading the jsp

2002-12-12 Thread Vikram Goyal
Make sure that the bkObject is set in session not in request.

Rgs
Vikram
- Original Message - 
From: "Dinesh Samson J" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 12, 2002 8:14 PM
Subject:  error reloading the jsp


> Greetings,
>  
> I am retrieving a set of data for a field, from the database and loading
> my form with these values as listbox.
> This works fine.
> I key-in other details in the same form and click submit.
> In my forward mapping, for failure I refer the JSP.
>  
> When I loads the same JSP , I get an Jasper error 
> Cannot find bean under name bkobject
>  
>  
> 
>  labelProperty="beneName"/>
> 
>  
> I need to load the same page for any failures with the original data.
>  
> Is there anything property to set?
>  
>  
> Thanks in advance
>  
> regards,
>  
> Dinesh Samson J
> 
> 
>  
> 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Question About Modules

2002-11-21 Thread Vikram Goyal
We used FOP to generate dynamic pdf through the action. The action itself
returned null.

Vikram

- Original Message -
From: "Madel,Kurt" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, November 21, 2002 5:46 AM
Subject: RE: Question About Modules


> Anyone using modules and going through an action to generate dynamic
> database driven pdf's???  Anyone .
>
> Kurt Madel
> Programmer, CSMi
> (703) 823-4300 ext. 170
>
>
> -Original Message-
> From: Madel,Kurt [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 20, 2002 11:27 AM
> To: 'Struts Users Mailing List'
> Subject: Question About Modules
>
> My understanding is that you have to use an extension mapping in order to
> use the Module functionality, i.e. '*.do'
>
> What are people doing if they need to serve say a '.pdf' from an action?
> That is, my pdf is dynamic and requires the use of the same DAO's that I
use
> for my jsp pages.  Sure you can set the mime type, but Internet Explorer
> ignores these most of the time and counts on the extension.  If you map
> *.pdf and *.do then you won't be able to server static pdf's???
>
> Kurt Madel
> Programmer, CSMi
> (703) 823-4300 ext. 170
>
>
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Max file size when upload in struts-1.1b2

2002-11-21 Thread Vikram Goyal
Set the following in the struts-config.



For file sizes in MB use 1M, 1.5M etc.

HTH
Vikram


- Original Message -
From: "Huynh Ngoc Huy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 21, 2002 7:33 PM
Subject: Max file size when upload in struts-1.1b2


>   Dear group,
>   I'm using struts-1.1b2. What should I do to set the
> maximum file size over 1M as I want to upload a file?
>   Thanks,
>   Huy
>
>
> __
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: ClassCastException - Using TreeMap

2002-11-14 Thread Vikram Goyal
Thanks for your help, but I figured out the problem.

The problem was that I was explicitly declaring the type to be
java.util.TreeMap. Removing that solves the problem.

Regards,
Vikram

- Original Message -
From: "Vinh Tran" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, November 14, 2002 11:03 PM
Subject: RE: ClassCastException - Using TreeMap


> try this...
>
> 
>
> -Original Message-
> From: Vikram Goyal [mailto:tech@;craftbits.com]
> Sent: Thursday, November 14, 2002 7:52 AM
> To: Struts Users Mailing List
> Subject: ClassCastException - Using TreeMap
>
>
> Hello All,
>
> I am getting a ClassCastException when using a TreeMap in a logic iterate.
I
> am reproducing part of the error below.
>
> java.lang.ClassCastException: java.util.TreeMap$Entry
>  at
_web_22dinf._jsp._mycraft__jsp._jspService(/WEB-INF/jsp/mycraft.jsp:26)
>
> I understand that while using a TreeMap, the values returned are part of
the
> Inner class Entry. But why should this give me an error here?
>
> My logic iterate looks like:
>
> 
>
> type="java.util.TreeMap">
> 
>  
>   
>
> 
>
> where user is the bean that contains a TreeMap property of bookmarks.
>
> Any help appreciated.
>
> Regards,
> Vikram
>
>
> --
> 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>
>
>
>


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




ClassCastException - Using TreeMap

2002-11-14 Thread Vikram Goyal
Hello All,

I am getting a ClassCastException when using a TreeMap in a logic iterate. I
am reproducing part of the error below.

java.lang.ClassCastException: java.util.TreeMap$Entry
 at _web_22dinf._jsp._mycraft__jsp._jspService(/WEB-INF/jsp/mycraft.jsp:26)

I understand that while using a TreeMap, the values returned are part of the
Inner class Entry. But why should this give me an error here?

My logic iterate looks like:



   

 
  



where user is the bean that contains a TreeMap property of bookmarks.

Any help appreciated.

Regards,
Vikram


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Dynamic Value for logic equal

2002-11-09 Thread Vikram Goyal
Thanks David/Edgar,

I have actually done it in a scriptlet, but it is departing from the idea of
keeping JSP's scriptlet free. I am surprised that there is no generic way of
handling this in Struts. I always assumed that it would be till I actually
had to do it !!

The EL approach seems better but how was this tackled before Struts-EL came
into picture? I am guessing the scriptlet way?

Regards,
Vikram

- Original Message -
From: "David M. Karr" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, November 10, 2002 10:23 AM
Subject: Re: Dynamic Value for logic equal


> >>>>> "Vikram" == Vikram Goyal <[EMAIL PROTECTED]> writes:
>
> Vikram> When displaying information about a User, I need to display
the Label for a
> Vikram> Country Code. This should be simple enough. However, the User
bean contains
> Vikram> only the country code. To get the Country label, I need to
iterate over the
> Vikram> Country Data static collection, which stores information about
each country
> Vikram> as a LabelValueBean. This collection is stored in session
scope.
>
> Vikram> However, the problem is that while inside the logic:iterate
tag, the
> Vikram> logic:equal tag does not accept dynamic value for the 'value'
attribute. The
> Vikram> processing should be like this:
>
> Vikram>  Vikram> type="org.apache.struts.util.LabelValueBean">
> Vikram>  Vikram> value="USER.GETCOUNTRYCODE">
> Vikram> 
> Vikram> 
> Vikram> 
>
> Vikram> The USER.GETCOUNTRYCODE is the problem part. I have tried
value=' Vikram> name="user" property="country"/>'. This does not work, as it
seems that it
> Vikram> is parsed as is by the compiler. I also tried using
bean:define for the
> Vikram> country code and then passing that in but that fails as well.
>
> Vikram> I ended up writing a scriptlet around it to solve the problem,
but am not
> Vikram> convinced that it is the best way to go about it.
>
> Your alternatives are to use a scriptlet or to use the Struts-EL library
in the
> nightly build (as described in another response to this).  With Struts-EL,
a
> direct translation of your code would look something like the following
(with
> some renaming):
>
>  
>   
>
>   
>  
>
> --
> ===
> David M. Karr  ; Java/J2EE/XML/Unix/C++
> [EMAIL PROTECTED]   ; SCJP
>
>
>
> --
> 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>




Dynamic Value for logic equal

2002-11-09 Thread Vikram Goyal
Hello All,

I have searched the list for some time now and could not find a conclusive
answer for my problem. I am hoping someone else has come across this and can
help me.

When displaying information about a User, I need to display the Label for a
Country Code. This should be simple enough. However, the User bean contains
only the country code. To get the Country label, I need to iterate over the
Country Data static collection, which stores information about each country
as a LabelValueBean. This collection is stored in session scope.

However, the problem is that while inside the logic:iterate tag, the
logic:equal tag does not accept dynamic value for the 'value' attribute. The
processing should be like this:







The USER.GETCOUNTRYCODE is the problem part. I have tried value=''. This does not work, as it seems that it
is parsed as is by the compiler. I also tried using bean:define for the
country code and then passing that in but that fails as well.

I ended up writing a scriptlet around it to solve the problem, but am not
convinced that it is the best way to go about it.

Any help would be greatly appreciated.

Regards,
Vikram


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Reroute to login page

2002-11-01 Thread Vikram Goyal
You could also use the inbuilt ForwardAction.

Details are in the javadocs of Struts.

Regards,
Vikram

- Original Message -
From: "Mohan Radhakrishnan" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, November 01, 2002 9:42 PM
Subject: RE: Reroute to login page


> Hi,
>I solved my problem by using an action and forwarding to the login
page.
>
> 
>   border="0" alt="">
>  
> 
>
> Thanks,
> Mohan
>
> -Original Message-
> From: Mohan Radhakrishnan
> Sent: Friday, November 01, 2002 4:05 PM
> To: 'Struts Users Mailing List'
> Subject: Reroute to login page
>
>
> Hi,
>Does html:link need an action class?
>
> 
>
> I want to show the login page again when the user logs off. I am thinking
> that it is not possible without associating an action.
>
> 
> type="com.hcl.smartmanage.web.LogoutAction"
>name="noDataForm"
>scope="request">
>
>
>  If I use a normal html href( no tags, just html ) instead of html:link
then
> the context doesn't get prefixed  to the action.
>
>   html:link --> http://localhost/SmartManage/logoff.action
>   href  --> http://localhost/logoff.action
>
> What is the best way to re-route to the login page when the user logs off?
>
> Thanks,
> Mohan
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Resource temporarily unavailable

2002-10-29 Thread Vikram Goyal
All,

This is probably off topic and if so I apologize.

I shifted my hosts from a non JSP one to a JSP one short time ago.  The deal
was 500 MB disk space, 15GB transfer, and private JVM and Resin for 235 USD
a year. Too good to be true? Probably is??

Anyways, this is the problem:

I deployed my Struts specific test war file ( which opens up 10 connections
to the database ) on the server and as soon as I restarted Resin, I started
getting these messages on the screen whenever I tried running a command:

[: =: unary operator expected
bash: fork: Resource temporarily unavailable

Tech support tells me that it is because I have over stepped my allocated
processes (30). Now my question is, would Struts start something behind the
scenes that could make these processes? I have been taking the high stand
and saying that it is not possible that Struts would do such a thing but I
dont know for sure. Tech support just refuses to believe that and think that
is my code.

On a side note, does anybody know of a decent host that would give you a
private JVM for a decent price and good tech support and runs Struts without
problems?

Thanks for any help on this.

Regards,
Vikram


--
To unsubscribe, e-mail:   
For additional commands, e-mail: