Re: ActionForm and Transfer Object

2004-08-25 Thread simarjit singh
Hi,
I think the usual convention of not using ActionForm in Business tier is 
to separate these tiers.
This helps to reduce business tier dependency on Web tier.

I read a design pattern and  modified  it  to my needs .
Here is what i do.
1. Make a tagging interface like AppForm which is generalized . All the 
actionForm classes  extend ActionForm and implement AppForm.
Now When i pass it to business tier i simply accept AppForm . Then i can 
type cast it to required class in business tier .

I used it to simply prevent seeing ActionForm in Business tier . I don't 
know whether it is good idea.
but i really wanted to get rid of the hassle in moving values across 
form and TO.
If some other framework , ( other than struts) there will be some way 
to get value from  screens  and we will make all those object also 
implement AppForm .

Now  one can say that at that time we will make a tagging interface 
ActionForm . it is ok. but Still it will make it look like a badly 
written code.

ciao

Sebastian Ho wrote:
Hi
People have been telling me that ActionForm should not be dependent on
your TO. Simple because actionForm is for presentation and TO for your
business requirement. Sounds logical and right way to go.
Now that I started developing using struts, it is actually not that
simple. 

Say I retrieve a TO from database and convert it into a actionForm for
display. In this case I have 4 fields for my actionForm but 10 in my TO.
(6 are not needed for display). A user updates the 4 fields and the
action convert those into TO. In this case, the other 6 fields will be
reset to null(or empty) in my database!
To prevent this, I actually need to use hidden fields in my JSP or some
other ugly solutions in my Action class. They are still dependent on
each others afterall.
Is there a solution to this or I am missing something here?
Thanks
Sebastian Ho
-
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: OC4J and struts issue

2004-08-16 Thread simarjit singh
Kindly have a look
at my struts-config.xml , i have reduced it almost nothing
*** struts-config.xml**

http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>

 


ApplicationResources.properties is under WEB-INF/classes
**  jsp page **
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>




test

***
So there is not much space to make a mistake , but i am still able to do 
that :-)

Can there be any issue with classpaths? .I have everything in WEB-INF/lib
error is
javax.servlet.jsp.JspException: Cannot find message resources under key 
org.apache.struts.action.MESSAGE
at org.apache.struts.util.RequestUtils.message(RequestUtils.java:793)
at org.apache.struts.util.RequestUtils.message(RequestUtils.java:755)
at 
org.apache.struts.taglib.html.BaseHandlerTag.message(BaseHandlerTag.java:568)
at 
org.apache.struts.taglib.html.BaseHandlerTag.prepareStyles(BaseHandlerTag.java:623)
at org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:355)
at _adhoc._selection._jspService(_selection.java:64)
[SRC:/adhoc/selection.jsp:10]
.
.


thanks,simar
here is the test jsp content
Vic Cekvenich wrote:
It's usualy a case issues in some xml, since windows is not case 
sensetive.
Look for that.

Next time, if you deploy to unix, develop in unix.
.V
I am able to run it in windows environment but when i move it to 
solaris, it is failing.:-(


-
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: OC4J and struts issue

2004-08-16 Thread simarjit singh
it is like
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
so uri is different .
Thanks simar
Veerabhadra Rao R wrote:
In jsp page if you are including the tag lib files like this
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
your taglib code in web.xml file should be like this

 
   /tags/struts-bean
   /WEB-INF/struts-bean.tld
 
 
   /tags/struts-html
   /WEB-INF/struts-html.tld
 
 
   /tags/struts-logic
   /WEB-INF/struts-logic.tld
 
 
   /tags/struts-nested
   /WEB-INF/struts-nested.tld
 
 
   /tags/struts-tiles
   /WEB-INF/struts-tiles.tld
 


Thanks
Veera
-Original Message-
From: simarjit singh [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 16, 2004 5:51 PM
To: Struts Users Mailing List
Subject: Re: OC4J and struts issue

Thanks for quick reply,
here is my web.xml entry. it is generated by jdeveloper.it is not
manual.
I am able to run it in windows environment but when i move it to 
solaris, it is failing.:-(


   /WEB-INF/struts-bean.tld
   /WEB-INF/struts-bean.tld
 
 
   /WEB-INF/struts-html.tld
   /WEB-INF/struts-html.tld
 
 
   /WEB-INF/struts-logic.tld
   /WEB-INF/struts-logic.tld
 
Thanks,simar
Veerabhadra Rao R wrote:
 

Hi,
Can you verify the tag lib directives in web.xml.  you will get such
type of error messages only when there is mismatching in tag lib
directives.


  /tags/struts-bean
  /WEB-INF/struts-bean.tld


  /tags/struts-html
  /WEB-INF/struts-html.tld


  /tags/struts-logic
  /WEB-INF/struts-logic.tld


  /tags/struts-nested
  /WEB-INF/struts-nested.tld


  /tags/struts-tiles
  /WEB-INF/struts-tiles.tld


Thanks
Veera
-Original Message-
From: simarjit singh [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 16, 2004 5:37 PM
To: Struts Users Mailing List
Subject: OC4J and struts issue

Hi,
I am getting th following error mesage in OC4J for 9i.
javax.servlet.jsp.JspException: Cannot find message resources under key
   

 

org.apache.struts.action.MESSAGE
at org.apache.struts.util.RequestUtils.message(RequestUtils.java:793)
at org.apache.struts.util.RequestUtils.message(RequestUtils.java:755)
at 
org.apache.struts.taglib.html.BaseHandlerTag.message(BaseHandlerTag.jav
   

a
 

:568)
at 
org.apache.struts.taglib.html.BaseHandlerTag.prepareStyles(BaseHandlerT
   

a
 

g.java:623)
at org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:355)
at _adhoc._selection._jspService(_selection.java:64)
[SRC:/adhoc/selection.jsp:10]
at com.orionserver[Oracle9iAS (9.0.2.1.0) Containers for 
J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at
oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:508
   

)
 

at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:255)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:407)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:330)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind[Oracle9iAS (9.0.2.1.0) Containers for 
J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatc
   

h
 

er.java:696)
at com.evermind[Oracle9iAS (9.0.2.1.0) Containers for 
J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletReque
   

s
 

tDispatcher.java:281)
at com.evermind[Oracle9iAS (9.0.2.1.0) Containers for 
J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.
   

j
 

ava:766)
at com.evermind[Oracle9iAS (9.0.2.1.0) Containers for 
J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind[Oracle9iAS (9.0.2.1.0) Containers for 
J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:107)
at 
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecut
   

o
 

r.java:802)
at java.lang.Thread.run(Thread.java:479)


Can any body help.
Thanks in advance,
Simar
Information transmitted by this EMAIL is proprietary to iGATE Group of
   

Companies and is intended for use only by the individual or entity to
whom it is addressed and may contain information that is privileged,
confidential, or exempt from disclosure under applicable law. If you are
not the intended recipient of this EMAIL immediately notify the sender
at iGATE or [EMAIL PROTECTED] and delete this EMAIL including any
attachments.
 

-
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]

Information transmitted by this EMAIL is proprietary to iGATE Group of Companies and 
is intended for use only by the individual or entity to whom it is addressed and may 
contain information that is privileged, confidenti

Re: OC4J and struts issue

2004-08-16 Thread simarjit singh
Thanks for quick reply,
here is my web.xml entry. it is generated by jdeveloper.it is not manual.
I am able to run it in windows environment but when i move it to 
solaris, it is failing.:-(


   /WEB-INF/struts-bean.tld
   /WEB-INF/struts-bean.tld
 
 
   /WEB-INF/struts-html.tld
   /WEB-INF/struts-html.tld
 
 
   /WEB-INF/struts-logic.tld
   /WEB-INF/struts-logic.tld
 
Thanks,simar
Veerabhadra Rao R wrote:
Hi,
Can you verify the tag lib directives in web.xml.  you will get such
type of error messages only when there is mismatching in tag lib
directives.

 
   /tags/struts-bean
   /WEB-INF/struts-bean.tld
 
 
   /tags/struts-html
   /WEB-INF/struts-html.tld
 
 
   /tags/struts-logic
   /WEB-INF/struts-logic.tld
 
 
   /tags/struts-nested
   /WEB-INF/struts-nested.tld
 
 
   /tags/struts-tiles
   /WEB-INF/struts-tiles.tld
 

Thanks
Veera
-Original Message-
From: simarjit singh [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 16, 2004 5:37 PM
To: Struts Users Mailing List
Subject: OC4J and struts issue

Hi,
I am getting th following error mesage in OC4J for 9i.
javax.servlet.jsp.JspException: Cannot find message resources under key 
org.apache.struts.action.MESSAGE
at org.apache.struts.util.RequestUtils.message(RequestUtils.java:793)
at org.apache.struts.util.RequestUtils.message(RequestUtils.java:755)
at 
org.apache.struts.taglib.html.BaseHandlerTag.message(BaseHandlerTag.java
:568)
at 
org.apache.struts.taglib.html.BaseHandlerTag.prepareStyles(BaseHandlerTa
g.java:623)
at org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:355)
at _adhoc._selection._jspService(_selection.java:64)
[SRC:/adhoc/selection.jsp:10]
at com.orionserver[Oracle9iAS (9.0.2.1.0) Containers for 
J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at
oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:508)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:255)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:407)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:330)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind[Oracle9iAS (9.0.2.1.0) Containers for 
J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatch
er.java:696)
at com.evermind[Oracle9iAS (9.0.2.1.0) Containers for 
J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletReques
tDispatcher.java:281)
at com.evermind[Oracle9iAS (9.0.2.1.0) Containers for 
J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.j
ava:766)
at com.evermind[Oracle9iAS (9.0.2.1.0) Containers for 
J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind[Oracle9iAS (9.0.2.1.0) Containers for 
J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:107)
at 
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecuto
r.java:802)
at java.lang.Thread.run(Thread.java:479)



Can any body help.
Thanks in advance,
Simar
Information transmitted by this EMAIL is proprietary to iGATE Group of Companies 
and is intended for use only by the individual or entity to whom it is addressed and 
may contain information that is privileged, confidential, or exempt from disclosure 
under applicable law. If you are not the intended recipient of this EMAIL immediately 
notify the sender at iGATE or [EMAIL PROTECTED] and delete this EMAIL including any 
attachments.
-
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]


OC4J and struts issue

2004-08-16 Thread simarjit singh
Hi,
I am getting th following error mesage in OC4J for 9i.
javax.servlet.jsp.JspException: Cannot find message resources under key 
org.apache.struts.action.MESSAGE
at org.apache.struts.util.RequestUtils.message(RequestUtils.java:793)
at org.apache.struts.util.RequestUtils.message(RequestUtils.java:755)
at 
org.apache.struts.taglib.html.BaseHandlerTag.message(BaseHandlerTag.java:568)
at 
org.apache.struts.taglib.html.BaseHandlerTag.prepareStyles(BaseHandlerTag.java:623)
at org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:355)
at _adhoc._selection._jspService(_selection.java:64)
[SRC:/adhoc/selection.jsp:10]
at com.orionserver[Oracle9iAS (9.0.2.1.0) Containers for 
J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:508)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:255)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:407)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:330)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind[Oracle9iAS (9.0.2.1.0) Containers for 
J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:696)
at com.evermind[Oracle9iAS (9.0.2.1.0) Containers for 
J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:281)
at com.evermind[Oracle9iAS (9.0.2.1.0) Containers for 
J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:766)
at com.evermind[Oracle9iAS (9.0.2.1.0) Containers for 
J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind[Oracle9iAS (9.0.2.1.0) Containers for 
J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:107)
at 
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:802)
at java.lang.Thread.run(Thread.java:479)



Can any body help.
Thanks in advance,
Simar


RE: [OT] how to calculate the size of an object

2004-07-08 Thread simarjit singh
With ByteArrayOutputStream approach, writeObject Method is also serializing
the object. Ofcourse serialization doesn't give size as it is more of a meta
data for the entire web of objects associated with the serialized object.

Rather than writing serialized object on file we  are putting it in a byte
array stream.

What u are getting is NOT bytes for object but bytes for serliazed data


Correct me if i am wrong...

-Simar



-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 08, 2004 10:57 PM
To: Struts Users Mailing List
Subject: Re: [OT] how to calculate the size of an object


Also remember that when you serialize an Object (if I am not mistaken),
all the Objects referred to by that Object get serialized too (unless
the references are transient). In addition, there is serialization
overhead (protocol info that is not actually part of your Object but
that is required to deserialize). Your returned size could be misleading
if you have references to, say, some "parent" Object(s) in LDIFData, or
a ton of serialization overhead (unlikely).

Erik



Erik Weber wrote:

> public static long getSize(LDIFData data) {
> try {
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> ObjectOutputStream out = new ObjectOutputStream(baos);
> out.writeObject(data);
> out.close();
> return baos.toByteArray().length;
> }
> catch (Exception e) {
> e.printStackTrace();
> return -1;
> }
> }
>
> John Moore wrote:
>
>> Navjot Singh wrote:
>>
>>>
>>> I use SAX parser to load an LDIF file into memory. Whatsoever data i
>>> read, i fill into an object.
>>>
>>> I need to know *the size of LDIFData object* at runtime. How to do
>>> that?
>>>
>>> Well the class structure is something like this
>>>
>>> public class LDIFData{
>>> ArrayList cards; // collection of Card
>>> String filename;
>>> long lastLoadedTime;
>>> }
>>>
>>> public class Card{
>>> String name;
>>> String email
>>> String mobile;
>>> }
>>>
>> Off the top of my head...
>>
>> Serialize it to a byte array output stream, see how many bytes you have
>>
>> John
>>
>
> -
> 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]