why do we need to create packages

2006-06-07 Thread vijay r

Hello,

I was wondering why do we need to create packages to keep our
ActionForms, Action classes. Can't we do without creating packages.

I created the .class files in WEB-INF\classes directory and gave no
package names in struts-config.xml file. It gave NullPoniterException
- Error creating form bean of class Test.

regards,
vijay.

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



Re: why do we need to create packages

2006-06-07 Thread vijay r

That's fine. I know why packages are for. But why is it necessary to
create packages to keep our ActionForm classes, Action classes. Name
collision is the problem which the development team has to tackle.
What if the development team decides to name classes starting with
their Employee ID, probability of name collision decreases
considerably. Is it strictly enforced by Struts to use packages.

I dont think Java 1.5 specification speficies it explicitely to
compulsarily use packages. Any pointers, Andre. Doesn't the compiler
create a default package.

regards,
vijay.

On 6/7/06, Sharadha Yadav [EMAIL PROTECTED] wrote:



Packages are created to avoid  collision in namespace...


Supposing you have two different classes with same name, you need to
associate the class with a package to make clear that the class comes
from a particular package...







Thanks and Regards,
Sharadha Yadav M.S.
Infosys Technology Ltd.

-Original Message-
From: vijay r [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 07, 2006 11:32 AM
To: Struts Users Mailing List
Subject: why do we need to create packages

Hello,

I was wondering why do we need to create packages to keep our
ActionForms, Action classes. Can't we do without creating packages.

I created the .class files in WEB-INF\classes directory and gave no
package names in struts-config.xml file. It gave NullPoniterException
- Error creating form bean of class Test.

regards,
vijay.

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


 CAUTION - Disclaimer *
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not to copy, disclose, or distribute this e-mail or its contents to any other 
person and any such actions are unlawful. This e-mail may contain viruses. 
Infosys has taken every reasonable precaution to minimize this risk, but is not 
liable for any damage you may sustain as a result of any virus in this e-mail. 
You should carry out your own virus checks before opening the e-mail or 
attachment. Infosys reserves the right to monitor and review the content of all 
messages sent to or from this e-mail address. Messages sent to or from this 
e-mail address may be stored on the Infosys e-mail system.
***INFOSYS End of Disclaimer INFOSYS***

-
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: why do we need to create packages

2006-06-07 Thread vijay r

Its not that I do not want to create any packages, I just wanted to
check whether the ActionForms, Actions work without a package or not.


http://marc.theaimsgroup.com/?l=tomcat-userm=104265745710637w=2


My ActionForm, Action have no packages and they are working. I made a
silly mistake in struts-config.xml because of which it was not
working.

But how come its working. My ActionForm is instantiated by some class
in the struts package. How can that class see my ActionForm which is
in an anonymous package.

regards,
vijay.



On 6/7/06, Sateesh Nelluri [EMAIL PROTECTED] wrote:

Hi
See this clarification from Will Hartung.

http://marc.theaimsgroup.com/?l=tomcat-userm=104265745710637w=2

Hope this should clear the things..

-sateesh



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



Re: Form reset()

2006-06-07 Thread vijay r

Suppose we have a page P1.jsp which has a corrosponding form bean,
say, TestForm. If the scope of the bean is request, then whenever we
access P1.jsp, the reset() method will be called.

If the scope is session, reset() method will be called only for the
first time, when the bean is actually loaded. On further access to
P1.jsp, reset() will not be called.

But on submission of P1.jsp, reset() is called for both the scopes.

regards,
vijay.


On 5/29/06, Philihp Busby [EMAIL PROTECTED] wrote:

ActionForm objects are reused. A new one may not necessarily be
created every time a form is submitted... Struts will try and reuse
one from a pool of ActionForm objects.

If there's a free one, it calls reset() before populating it in the
controller with form values and hands it to your action.

If there's no free one, it creates a new one, calls reset(), then
populates it with form values and hands it to your Action.

You want to reset all of your ActionForm's fields to empty or
nothing, or whatever you want the default value to be if the HTTP
request doesn't include any parameters. It's a best practice to do
every field, even if all of your HTML forms have fields for each of
the attributes... and even if they do, HTTP checkboxes are only
included in parameters if they're checked... if they're unchecked then
your HTTP request won't contain that parameter.

On 5/29/06, Miguel Galves [EMAIL PROTECTED] wrote:
 Hi,

 can someone tell exactly in which cases the ActionForm.reset() method
 is called ? More specifically, when an action or a erro handler redirects
 the system to a specific DispatchAction method, as showed in the code
 below, dos struts reset the form ?

 public class MyExceptionHandler extends ExceptionHandler {

 public ActionForward execute(Exception error,
  ExceptionConfig ec,
  ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response) throws
 ServletException {


 // create action forward
 ActionForward forward = new ActionForward(mapping.getPath() +
 .do?action=error);
  ex.printStackTrace();

 if (error instanceof AuthorizationException || error instanceof
 AuthenticationException)
 return (mapping.findForward(logon));

 return forward;
 }

 }


 --
 Miguel Galves - Engenheiro de Computação
 Já leu meus blogs hoje?
 Para geeks http://log4dev.blogspot.com
 Pra pessoas normais
 http://miguelgalves.blogspot.com

 Não sabendo que era impossível, ele foi lá e fez...





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



date picker (tried javawebparts but facing problem)

2006-04-20 Thread vijay r
Hello,

I need to use a data picker. I tried javawebparts but I am getting the
problem of class version incompatibility for class 'CalendarTag'. I am
using WAS 5.0 which is based on JDK 1.3.

Is there a version of javawebparts for JDK 1.3 which I can use. Or is
there any other free date picker available.

regards,
vijay.

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



{Maybe OT} Ajax with struts

2006-04-11 Thread vijay r
Hello,

I used AJAX to fill details for a corrosponding selected value listed in a
combo box. So for a particular registration number, the details of the
vehicle are filled.

On the onchange() event of the combo box, I am calling a JavaScript function
which creates a XmlHttpRequest with the url = RegDetails.do?action=populate
where action is a DispatchAction parameter. I am working in Websphere
Application Developer Studio and its working great in it. But when I deploy
the application in Websphere AS 5.0, the AJAX stuff does not work.

Pre-population of the jsp form works great (which is also based on
DispatchAction - I give
http://localhost:9080/dpims/RegDetails.do?action=populate). Only the AJAX
stuff does not work. I get the following error

[4/11/06 12:07:14:250 IST] 5fbb0406 DispatchActio E
org.apache.struts.actions.DispatchAction  Request[/RegDetails] does not
contain handler parameter named action

I am not able to figure out the problem.

regards,
vijay.


Re: {Maybe OT} Ajax with struts

2006-04-11 Thread vijay r
Yes, that was the problem.

I changed the POST parameter to GET in http.open(); and its working. Keeping
it POST and passing the parameters in send() does not work.

Anyways, making it GET works and thats what I need. But what could be the
problem?

regards,
vijay.


On 4/11/06, Michael Jouravlev [EMAIL PROTECTED] wrote:

 On 4/10/06, vijay r [EMAIL PROTECTED] wrote:
  Hello,
 
  I used AJAX to fill details for a corrosponding selected value listed in
 a
  combo box. So for a particular registration number, the details of the
  vehicle are filled.
 
  On the onchange() event of the combo box, I am calling a JavaScript
 function
  which creates a XmlHttpRequest with the url = RegDetails.do
 ?action=populate
  where action is a DispatchAction parameter. I am working in Websphere
  Application Developer Studio and its working great in it. But when I
 deploy
  the application in Websphere AS 5.0, the AJAX stuff does not work.
 
  Pre-population of the jsp form works great (which is also based on
  DispatchAction - I give
  http://localhost:9080/dpims/RegDetails.do?action=populate). Only the
 AJAX
  stuff does not work. I get the following error
 
  [4/11/06 12:07:14:250 IST] 5fbb0406 DispatchActio E
  org.apache.struts.actions.DispatchAction  Request[/RegDetails] does not
  contain handler parameter named action
 
  I am not able to figure out the problem.

 If you use POST for your XHR, you must specify request parameters in
 XHR.send(...) instead of appending them to action address. If you use
 GET, well, your URL seems ok, I would pass null in XHR.send(...) but I
 am not sure that this is the problem.

 Michael.

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