Siddharth Naik

Ranch Hand
+ Follow
since Apr 09, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Siddharth Naik

What are some of the best options for organizing packages in a J2EE application?

I did some googling to find the answer but most of the pages talked about over all directory structure of J2EE applications and not how specific packages within src directory should be organized. Here are a few options I am aware of based on my work experience at a few organizations.

----------------------------------------------------------------------------------------

Option 1: organize based on technical artifacts

com.mycompany.bo (includes files like: Customer.java, CreaditCard.java, Account.java, Promotion.java)
com.mycompany.services (includes files like: UserManaer.java, Authorization.java, Accounting.java, DiscountManager.java)
com.mycompany.actions (includes files like: Login.java, Authorize.java, AccountLookup.java, CalculateDiscount.java)
com.mycompany.dto
com.mycompany.assemblers

Pros: intuitive package structure; I know how the code would look like in each package
Cons: If I am debugging a business issue then it's hard to find out which packages might be involved

----------------------------------------------------------------------------------------

Option 2: organize based on business concerns

com.mycompany.customer (includes files like: Customer.java,UserManaer.java,LoginAction.java)
com.mycompany.payment (includes files like: CreaditCard.java, Authorization.java,Authorize.java)
com.mycompany.account (includes files like: Account.java,Accounting.java,AccountLookupAction.java)
com.mycompany.promotion (includes files like: Promotion.java,DiscountManager.java,CalculateDiscount.java)

Pros: everything related to customer is in one package so it's easy to figure out business dependency
Cons: My technical artifacts are divided across packages and I don't know what each file might contain without opening it

----------------------------------------------------------------------------------------

Option 3: Organize based on both - the business concerns and the technical artifacts

com.mycompany.beans.customer
com.mycompany.services.customer
com.mycompany.actions.customer
com.mycompany.beans.account
com.mycompany.services.accounts
com.mycompany.actions.accounts
...
...


Pros: clear separation both business wise and tech wise
Cons: too many packages and sometimes only one file in each package


How's it organized at your company and how do you like it? What would you recommend as the best option?

Thanks,
Sid
Hi,
I'm trying to create a wsdl from a simple java interface using Maven2 plugin axis2-java2wsdl. I get the following IOException. Any ideas?



Here is the POM file.




Here is a simple java interface.




Any help is appreciated.

Thanks,
Sid
14 years ago
I have Spring In Action (Manning Publications) and love it! It provides good conceptual understanding and code examples to work with.
14 years ago
Any recommendations on a good freeware Eclipse plugin for HTML development? It would be nice if it can show browser view - at least for plain HTML. Support for CSS, Java Script will also be helpful.

I searched http://www.eclipseplugincentral.com and found 118 solutions. So I'd like to learn from your experiences.
[ December 17, 2008: Message edited by: Siddharth Naik ]
If you have copy-pasted the code then there is typo in both cases:

(1) In the first case timeout is spelled wrong
<session-timoeout>1</session-timoeout>


(2) In the second case "m" in max needs to be capital
session.setmaxInactiveInterval(60);
[ July 14, 2008: Message edited by: Siddharth Naik ]
15 years ago
html select tag has all attributes you have used in the code above. Please refer to Taglib Doc.

http://struts.apache.org/1.x/struts-taglib/tlddoc/index.html

You will also find an example in this discussion:

https://coderanch.com/t/59022/Struts/decreasing-width-drop-down-box
15 years ago
Sounds like your problem is related to the following thread:

https://coderanch.com/t/58954/Struts/TILES-include-action-as-body

In the above-mentioned thread, action is used as body in a tiles definition. This way tiles will always call an action first to render JSP. You can define the variable and get required value in action to arrive at desired JSP dynamically.
15 years ago
You might be able to use attribute styleClass of struts html:select tag. This styleClass is similar to class attribute in html select tag and can be customized in CSS file.

For example in CSS you can use code like this:



You can then use styleClass="FormBox50" in html:select tag.

Hope this works out for you.
15 years ago
java:comp/env is the standard J2EE prefix used to lookup resources via JNDI.
15 years ago
There is a link to one free book on Struts Category FAQ:

http://www.infoq.com/minibooks/starting-struts2
15 years ago
(1) Put JDBC driver to appropriate server directory. For Tomcat put it under: Tomcat/commons/lib directory

(2) Create context.xml under META-INF directory of your project with following code. Replace values specific to your environment including driverClassName of your database.



You can also add other parameters like maxActive, maxWait etc. Do google search for context.xml and you will find details.

(3) Use the following code for JNDI lookup



Use conn object from above code for creating Statement or preferably PreparedStatement to execute the query.
[ July 07, 2008: Message edited by: Siddharth Naik ]
15 years ago
Because URL rewriting doesn't use client side cookies.

[ July 07, 2008: Message edited by: Siddharth Naik ]
[ July 07, 2008: Message edited by: Siddharth Naik ]
15 years ago
URL rewriting is used while sending response and not while setting session attributes. So set and get session attributes as usual and call encodeURL method on response object.

15 years ago
Oh and don't forget to register your listener in web.xml

15 years ago