RE: Wht does load-on-startup tag in web.xml means ??

2003-12-03 Thread Tapan Nanawati
Hi Shakti,
 load-on-startup means you want call your servlet class at the time of
server startup.
A typical use will be for loading context/application level parameters in
the memory.
The value indicates the order in which servlets are loaded.
For eg:- 1 indicates this servlet will be loaded first. 
Also, You want action servlet to be loaded before calling your personal
servlet.
Tapan


-Original Message-
From: Shakti [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 6:13 PM
To: Struts Users Mailing List
Subject: Wht does load-on-startup tag in web.xml means ??


Hi,
Wht does load-on-startup tag in web.xml means ?? I am using struts
framework with weblogic and i am not able to find out wht is does this tag
implies ? Is this the cause due to which my weblogic is not picking up new
compiled classes without restarting ..???
waiting for a reply 
Thanks  Regards,
Shakti.


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



Error 404 - communicating with jsession id between two servers

2003-12-01 Thread Tapan Nanawati
Hi All,
I have a typical problem.
I have iPlanet and Weblogic installed. iPlanet is forwarding request to weblogic.
 
1) From iPlanet server I make a call :-
172.31.235.253 - - [26/Nov/2003:11:26:56 +0900] GET 
/shvn/dfw/INTEAPP/directDerivatives/BankAdminAuditLog.do HTTP/1.1 200 14149
This call is forwarded to weblogic and I get the page loaded.
 
2) I have a Run button on the page:-
When I click on Run this is the URL generated in iPlanet server logs (same thing seen 
in the URL):-
172.31.235.253 - - [26/Nov/2003:11:28:19 +0900] POST 
/shvn/dfw/INTEAPP/directDerivatives/BankAdminAuditLog.do;jsessionid=1EP150JOqJYdAj8YI80z9tx1CgaD3fJtN8oD15pW92rJbPKWIngI!490032195!-1407194149!8080!7002
 HTTP/1.1 404 1317
 
jsessionid was attached in the URL and this results in 404.
 
The entry in weblogic access log shows this :-
2003-11-26 02:28:20 0.0060 POST 
/directDerivatives/BankAdminAuditLog.do%3bjsessionid%3d1EP150JOqJYdAj8YI80z9tx1CgaD3fJtN8oD15pW92rJbPKWIngI!490032195!-1407194149!8080!7002
 404 1317 172.31.235.215
 
3) NOW I press browser back and refresh the page :
And after this when I press RUN - I get data from weblogic correctly.
 

The URL becomes : -
172.31.235.253 - - [26/Nov/2003:11:29:44 +0900] GET 
/shvn/dfw/INTEAPP/directDerivatives/BankAdminAuditLog.do HTTP/1.1 200 14149
 
 
Where is the problem coming: I understand : weblogic must be sending jsessionid when 
the first call is being made: but why is iplanet not able to display it.
 
Please help.
Thanks Very much in Advance.
Tapan


-
Do you Yahoo!?
Free Pop-Up Blocker - Get it now

Null pointer in PropertyUtils - set method not getting called in form-bean

2003-07-24 Thread Tapan Nanawati
I have a colletion(ArrayList) : TenureMatrix which contains beans.
This I am initializing in the action class on first call and setting it in
the request scope.

This is my code for displaying the data  -- I am using struts-layout taglib
for this.

layout:collection name=TenureMatrix
layout:collectionInput title=trader.tenor property=spTenureYear
formProperty=spTenureYear  /
layout:collectionInput title=trader.tenor
property=spTenureMonth formProperty=spTenureMonth /
layout:collectionInput title=trader.tenor property=spTenureDays
formProperty=spTenureDays /
layout:collectionInput title=trader.tenor property=maxSpread
formProperty=maxSpread /
layout:collectionInput title=trader.tenor property=minSpread
formProperty=minSpread/
/layout:collection

The data is displayed properly on the first call to action. 

Here is the generated Html code:-

trth class=ARRAYTenor/thth class=ARRAYTenor/thth
class=ARRAYTenor/th
th class=ARRAYTenor/thth class=ARRAYTenor/th/trtr
td class=ARRAYinput type=text name=spTenureYear[0]
class=ERROR value=5/td
td class=ARRAYinput type=text name=spTenureMonth[0]
class=ERROR value=4/td
td class=ARRAYinput type=text name=spTenureDays[0]
class=ERROR value=4/td
td class=ARRAYinput type=text name=maxSpread[0]
class=ERROR value=44.454/td
td class=ARRAYinput type=text name=minSpread[0]
class=ERROR value=4.454/td
/trtr
td class=ARRAYinput type=text name=spTenureYear[1]
class=ERROR value=6/td
td class=ARRAYinput type=text name=spTenureMonth[1]
class=ERROR value=3/td
td class=ARRAYinput type=text name=spTenureDays[1]
class=ERROR value=7/td
td class=ARRAYinput type=text name=maxSpread[1]
class=ERROR value=66.454/td
td class=ARRAYinput type=text name=minSpread[1]
class=ERROR value=6.454/td
/tr/table/td/tr/table



The setters/getters exist in the form bean properly.

eg:- Variable declarations in form bean:-
String[] spTenureYear=null;

//  Get Sets :-
public String[] getSpTenureYear()
{
return this.spTenureYear;
}
public void setSpTenureYear(String[] spTenureYear)
{
System.out.println(spTenureYear+spTenureYear);
for (int i=0; ispTenureYear.length; i++ )
{
System.out.println( ~~~+spTenureYear[i] );
}
this.spTenureYear=spTenureYear;
}


However when I click on submit ( Calls the same action again ), I get a null
pointer in propertyutils!! what might be wrong?
In fact, even the System.out in the *setSpTenureYear* call is not getting
executed !!!

Help..

Jul 24, 2003 7:17:54 PM IST Error HTTP
[WebAppServletContext(1742385,default,/default)] Root cause of
ServletException
java.lang.NullPointerException
at
org.apache.commons.beanutils.PropertyUtils.setIndexedProperty(PropertyUtils.
java:1171)
at
org.apache.commons.beanutils.PropertyUtils.setIndexedProperty(PropertyUtils.
java:1099)
at
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.j
ava:1361)
at
org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:13
92)
at
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:562)
at
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:732)
at
org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:19
94)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1497)
at
com.integral.jsp.framework.IdcActionServlet.validateRequest(IdcActionServlet
.java:331)
at
com.integral.jsp.framework.IdcActionServlet.process(IdcActionServlet.java:13
9)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:505)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:265)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:200)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:2495)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)



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



How to prevent access to pdf files

2003-06-02 Thread Tapan Nanawati
Hi all,
I am on a page. There are a list of pdf files on the page. If a user
clicks on a pdf file, I want him to be redirected to a login page if he
is not logged in. 
However this doesnt seem to be happening even with filters. Does the
click on a pdf file not recognized as a request?
Please suggest, although the question is slightly offtopic.
Regards
Tapan


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



[RESEND] : Error coming in AppLogin tag - CheckLogin.java - Sample mail application

2003-04-01 Thread Tapan Nanawati
Hi friends,
I am working on struts -1.1 rc and tomcat 4.0.6.
I have installed  mail registration application and it is working fine.
I can see all the pages properly.

However if I open a new browser window and type the URL direcly :-
http://localhost:8080/myExample/mainMenu.jsp

I get a null pointer. Ideally it should send me to the login page.


javax.servlet.ServletException: java.lang.NullPointerException
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:471)
at org.apache.jsp.mainMenu$jsp._jspService(mainMenu$jsp.java:343)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
Cont  
root cause
javax.servlet.jsp.JspException: java.lang.NullPointerException
at
org.apache.struts.webapp.example.CheckLogonTag.doEndTag(CheckLogonTag.java:185)
at org.apache.jsp.mainMenu$jsp._jspService(mainMenu$jsp.java:86)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)



I tried to debug and found that :
In the below method, in the request.getAttribute()
 
ModuleConfig config = (ModuleConfig) pageContext.getRequest()   
.getAttribute(org.apache.struts.Globals.MODULE_KEY);

The *attribute* is not available and hence the null pointer.

Pleaese suggest how can I have org.apache.struts.Globals.MODULE_KEY in
the request.


public int doEndTag() throws JspException {
// Is there a valid user logged on?
boolean valid = false;
HttpSession session = pageContext.getSession();
if ((session != null)  (session.getAttribute(name) != null))
valid = true;
// ERROR - null
System.out.println( MODULE ~~ PC +
pageContext.getRequest().getAttribute(org.apache.struts.Globals.MODULE_KEY); );
// Forward control based on the results
if (valid)
return (EVAL_PAGE);
else {
  ModuleConfig config = (ModuleConfig)
pageContext.getRequest()
.getAttribute(org.apache.struts.Globals.MODULE_KEY);
try {
pageContext.forward(config.getPrefix() + page);
} catch (Exception e) {
throw new JspException(e.toString());
}
return (SKIP_PAGE);
}
   }

Please suggest.
Thanks
Tapan



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



Error in CheckApp - CheckLoginTag - Sample example mailapplication

2003-03-31 Thread Tapan Nanawati
Hi friends,
I am working on struts -1.1 rc and tomcat 4.0.6.
I have installed  mail registration application and it is working fine.
I can see all the pages properly.


However if I open a new browser window and type the URL direcly :-
http://localhost:8080/myExample/mainMenu.jsp

I get a null pointer instead of sending me to a login page.



javax.servlet.ServletException: java.lang.NullPointerException
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:471)
at org.apache.jsp.mainMenu$jsp._jspService(mainMenu$jsp.java:343)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
Cont  
root cause
javax.servlet.jsp.JspException: java.lang.NullPointerException
at
org.apache.struts.webapp.example.CheckLogonTag.doEndTag(CheckLogonTag.java:185)
at org.apache.jsp.mainMenu$jsp._jspService(mainMenu$jsp.java:86)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)



I tried to debug and found that :
In the below method, in the request.getAttribute()
 
ModuleConfig config = (ModuleConfig) pageContext.getRequest()   
.getAttribute(org.apache.struts.Globals.MODULE_KEY);

The *attribute* is not available and hence the null pointer.

Pleaese suggest how can I have org.apache.struts.Globals.MODULE_KEY in
the request.


   public int doEndTag() throws JspException {

// Is there a valid user logged on?
boolean valid = false;
HttpSession session = pageContext.getSession();
if ((session != null)  (session.getAttribute(name) != null))
valid = true;

// ERROR - null
System.out.println( MODULE ~~ PC +
pageContext.getRequest().getAttribute(org.apache.struts.Globals.MODULE_KEY); );


// Forward control based on the results
if (valid)
return (EVAL_PAGE);
else {
ModuleConfig config = (ModuleConfig)
pageContext.getRequest()
.getAttribute(org.apache.struts.Globals.MODULE_KEY);
try {
pageContext.forward(config.getPrefix() + page);
} catch (Exception e) {
throw new JspException(e.toString());
}
return (SKIP_PAGE);
}

}



Please suggest.

Thanks

Tapan


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



RE: Country select pull down.

2003-03-20 Thread Tapan Nanawati
That is very well explained robert.
Mick - however if you can avoid using countries from your own database
and ejb, use country taglib.That is a very clean way of using
countries.
Search for that.
Tapan

In case you want to use countries jsut in 
On Thu, 2003-03-20 at 20:16, Robert Taylor wrote:
  snipis this solution you
  mention something I can put in my DB, and use the dataSource to
  access directly like you mentioned?/snip
 No.
 First. I'm assuming your servlet container is 2.3 compliant and
 the country list does not change. If this is so,
 then you would want to implement a ServletContextListener. In the
 contextInitialized() you would get a reference to your EJB which
 is responsible for accessing the country list from the data source.
 Your EJB would retrieve the data in the form of a Collection of
 LabelValue beans. You would then place the Collection of LabelValue
 beans in the ServletContext under an attribute name; say countryOptions.
 
 At this point, the country list is available to your entire application
 under the countryOptions attribute name.
 
 
 If your country list must change based on the locale, then you would want
 to populate your country list in an Action which is invoked prior to
 displaying the page. In the Action you would basically go through the
 same process as defined above except you would store the list in the
 HttpServletSession as an attribute named countryOptions (if it didn't
 already exist). This way, it available to all requests from the specified
 locale.
 
 If the country list must change based on the locale and it is used on
 multiple pages, you could abstract the getCountryOptions() into a base
 Action or you could set up a filter which looks for the country list
 and populates it if it does not exist.
 
 There are probably other ways of accomplishing your objective as well,
 but the above were off the top of my head.
 
 robert
 
  If so, how, or where would I look to go in the right direction?
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Thursday, March 20, 2003 9:14 AM
  To: [EMAIL PROTECTED]
  Subject: RE: Country select pull down.
 
 
  I am using EJB's for my data currently, is this solution you
  mention something I can put in my DB, and use the dataSource to
  access directly like you mentioned?
  If so, how, or where would I look to go in the right direction?
 
 
_
 
  Thank You
 
  Mick Knutson
 
  Sr. Designer - Project Trust
  aUBS AG, Financial - Zürich
  Office: +41 (0)1/234.42.75
  Internal: 48194
  Mobile: 079.726.14.26
_
 
 
 
  -Original Message-
  From: Robert Taylor [mailto:[EMAIL PROTECTED]
  Sent: Thursday, March 20, 2003 2:52 PM
  To: Struts Users Mailing List
  Subject: RE: Country select pull down.
 
 
  Mick,
 
  Populate a collection of LabelValue beans with your countries
  (assuming your
  have something like countryId, countryName for each country) when your web
  app initializes (ServletContextListener-if 2.3) and place it
  in the ServletContext. Then on your .jsp page use the following syntax
  assuming your country list has an
  ServletContext attribute name of countryOptions.
 
  html:select property=country
  html:optionsCollection name=countryOptions label=countryName
  value=countryId
  /html:select
 
  This will reduce the number of custom tags by 277 which should do
  the trick.
  I believe html:optionsCollection .../ is available since 1.1b1.
 
  robert
 
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
   Sent: Thursday, March 20, 2003 2:20 AM
   To: [EMAIL PROTECTED]
   Subject: Country select pull down.
  
  
   I wanted to create a Country pull down with the html:select
   tag, but I have 280 countries added, but I get errors with a list
   that long.
   I have also read about the error here on this list about there
   being too many htm:... tags in a JSP, but,
   How do I add such a large pull down to a html:form?
  
  
  
  
   Thank You
  
   Mick Knutson
  
   Sr. Designer - Project Trust
   aUBS AG, Financial - Zürich
   Office: +41 (0)1/234.42.75
   Internal: 48194
   Mobile: 079.726.14.26
  
   Visit our website at http://www.ubswarburg.com
  
   This message contains confidential information and is intended only
   for the individual named.  If you are not the named addressee you
   should not disseminate, distribute or copy this e-mail.  Please
   notify the sender immediately by e-mail if you have received this
   e-mail by mistake and delete this e-mail from your system.
  
   E-mail transmission cannot be guaranteed to be secure or error-free
   as information could be intercepted, corrupted, lost, destroyed,
   arrive late or incomplete, or contain viruses.  The sender therefore
   does not accept liability for any errors or omissions in the contents
   of this message which arise as a result of e-mail transmission.  If
   verification is required please request a hard-copy version.  This
   message is