vishalraju shah

Greenhorn
+ Follow
since Oct 06, 2007
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 vishalraju shah

Thank you for your response again. Yeah, I'm thinking & validating my design. However, it's always good to understand feedback/review from people who have attempted such things. I'm now trying modular web-app approach with three modules

1) spring/dao - in a single jar
2) web-app (war format)
3) web-service (war format)

In above, last two refers 1st jar in pom.xml. I'll post if anything is un-obvious I come arcoess.

Thanks anyway for your response.

Cheers
Vishal
Hi Jimmy,

Thank you for your response. Can you help me in understanding why keeping those two seperate shall be better ? I've seen Appfuse framework example where they have got Web-Application & Web-Service (User service) tied togather in one war. I also posted similar question on their forum but has received no response yet.

Thanks,
Vishal
Hi All,

I'm kind of seek help in design (or may re-usable pattern) based on ranchers experience.

I have one Inventory web-service which has couple of operations exposed. I'm using Apache CXF (JAX-WS2.0) and design is simple as follow.

WebServiceImpl -> Spring Service (2.5.6) -> Hibernate DAO (3.x) -> DB (MySQL)

These web-services works fine & satisfies need for the business for end clients. However, I'm now in need of preparing a web-ui which pulls/updates the data using the web-app. (Not all CRUDS - But at least Read, update and search).

Design I'm preparing is-

WebApp (JSP) - Action - (Re-use) Spring Service (2.5.6) + Any new Services -> remaining layes as it is.

My intention is to re-use Spring Service layer and DAO layer I've written (May be with new interfaces for web-application). Is this a valid (good) design to tie back-end implementation of web-service & web-application togather ?

Thanks,
Vishal Shah
They both are declared differently,(This may appear in exam where you are gievn a exhibit and asked to choose which interface declaration is valid or not valid with given DD).

HttpSessionBindingListener doesn't need to be in DD (web.xml). Any object can implement this listener interface and provide impl. for valueBound and valueUnbound methods.

HttpSessionAttributeListener needs to be define in DD as and class has to provide impl. for it's methods.
<listener>
<listener-class>com.abc.MySessionAttributeListener</listener-class>
<listener>

They both share same event - HttpSessionBindingEvent.
That's really great . 100% requires really planned and organized preparation.

Congratulations... Have party time..
15 years ago
I gave SCWCD recently.I had 3-5 TAG related question(for simple/classic) which were bit tricky.

I do remember pattern in which it appeared :

1. For given custom tag , nested with other tags and either you are asked to traverse to parent or towards childs.
2. For given tag and you are asked that what all valid directives a tag can have or what all valid body types a tag can have.
3. Return types of the tag API methods (i.e for classic tags) and life cycle of when / how methods are called.

If you are refering HFSJ than cha. 9 last section and 10 is what I am pointing at.

Hope above input helps.
[ July 02, 2008: Message edited by: vishalraju shah ]
Hi All

Yesterday I cleared SCWCD(083) with 85% and it was really good experience.

I would like to say that SUN has made this exam really exciting and few question were really tricky . Only knowing API was not suffice as they had given detail scenarios and asked question based on that. Really 3 hr is good amount of time for this exam.

Any one preparing for SCWCD make sure you understand concept what fits where so that you can relate it nicely with scenarios and questions.

HFSJ is really nice book and thank for SCWCD links posted over here.

Kind Regards
Yup.The true excel files contains binary sort of data and doing the setContentType would not give that data, which makes diffrence in excel and asking browser to open it as csv/excel.

Thanks again.

[ February 18, 2008: Message edited by: vishalraju shah ]
[ February 18, 2008: Message edited by: vishalraju shah ]
16 years ago
JSP
Ben ,

Thanks.

Things are pretty clear.It seems I was incorrectly using response.setContentType... and understanding that it exports as excel but the file won't be true excel in reality. (I did explored POI and got it clear

Thanks once again.
[ February 18, 2008: Message edited by: vishalraju shah ]
16 years ago
JSP


"If users want to save the page as a PDF file or Excel file"



Ben ,
POI and iText are the more elegent solution and I agree to that. However if user here wanted to just save file in excel/pdf format which can be done by above way as per me.
16 years ago
JSP
If you are populating collection from DB -> coming to servelt -> going to jsp than following can be one of the way you can achieve your requirement.

<%@ page contentType="text/csv"%>
<% response.setHeader("Content-Disposition","inline; attachment; filename=Data.csv");
response.setHeader( "Pragma", "public" );
response.setHeader("Cache-Control", "cache");
response.setHeader("Cache-Control", "must-revalidate");
String separator = System.getProperty("line.separator");
pageContext.setAttribute("separator",separator);
%>

// iterate over your collection and print values seperate by ,(comma).
// This will prompt user to open/save a csv file.
16 years ago
JSP
Yes. You can pass object to the tag.

I am using JSP2.0 tag and following is what you can do.

Let's say you want to format address at more than one pages in your web application. So you are creating a formatAddress.tag which is re-usable.You will simply pass your address object and the tag will format it.(i.e Label, Adress line 1 , Address line 2 ,... )

Following is the code snippet for formatAddress.tag,look at the attribute specified.

<%@ tag description = "Outputs an address object in the correct format." pageEncoding="UTF-8"%>

<%@ attribute name="address" required="true" type="uk.co.fresca.pojo.Address"%>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>

//your custom logic to play with address format.


The caller of this tag would be
<xyz:formatAddress address="${addressPojo}"/>

Here xyz , is your taglib prefix.

Hope that helps.
16 years ago
JSP
You can set your form bean scope to session , which will preseve values between multiple requests. Make sure you haven't called form.reset()..anywhere in your code between requests.
[ January 14, 2008: Message edited by: vishalraju shah ]
16 years ago
Hello All,

I'm working on large web application which has got number of configuration parameters, i.e NO_OF_PRODUCTS_ON_SEARCH_SCREEN = 5.
Currently this parameters are in one Parameters.java file(statically loaded) and all action/ejb/jsp uses this .java file for usage.

if(Parameters.NO_OF_PRODUCTS_ON_SEARCH_SCREEN > 5){ //do something..}
else{ //do something else....}

Now ,as parameters do change frequently on client request, I have added all those to parameters to DB with creating proper schema. Lots of action/jsp/ejb uses this parameters(Let's say one web request uses 10 parameters) and If every time I make a DB request to lookup parameter it kills my performance so I have introduced caching between action/ejb/jsp and DB.I have used EHCache here and on lookup from acton/ejb/jsp goes to cache and cache result is returned if it's cached otherwise explicit DB request is made.

My application is in clustered environment and has got more than one server so I will have either go with 'cache replication' or 'share a cache'

Question 1 : If I am going to share cache , Is Symbolic link good solution?
Question 2 : What are the possible caching solution which has got this capability of replication in clustered environment. So far , I have explored EHcache , JCS and JBoss cache but need some more views (which is better,stable , faster for replication) to gain good performance in web-application.

Any views for above scenario or answers for questions would be great help.

[ January 06, 2008: Message edited by: vishalraju shah ]
[ January 06, 2008: Message edited by: vishalraju shah ]
16 years ago
First approach is MVC - Model View Controller design pattern , where you separating out your presentation layer.

Second approach is not really good to write code inside JSP for your session bean, here you are violating MVC patterns rule.

Read out few articles about MVC - this will give you clear picture.
16 years ago
JSP