gopal kishan

Ranch Hand
+ Follow
since Feb 23, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by gopal kishan

First of all there is no multiple instance of same Servlet. If more clients are accessing the Servlet then the container will create a thread for every request.

To answer your 1st question,

you can define that common variable in Web.XML which you want to share under <context-param> tag that way it will be shared by different client.

But if you use HttpSession it won't be shared by different Client but it will be shared by same client for different request.

for example Client opened a browser and hitting the servlet and the same client opened another browser hitting the servlet again.

To answer your point (1):
If you declare the variable in service method or accessing a property using HttpServeltRequest getParameter() method inside the service method it won't be shared by any thread at all. So it means no instance will be shared. these are thred safe by default.

But Session and application scope are not thread safe.
Kunal,

in EL , there are implicit scope objects, but those objects are not same as JSP implicit objects.

In EL all those implicit objects are map objects except PageContext which is same as JSP pageContext.

requestScope is just a Map of the request scope attributes, not the request object itself

In EL they just help you to specify what scope the values are in , but these are not the original objects, which means in JSP using scriptlet



here request refers to HttpServletRequest where as in EL



I hope you understand this.
Kunal,
The Symbol [] used to access map, bean, array, list.

In case of array you no need to use ${array["0"]} , you can simply use ${array[0]}, but how do you access map & bean? . There is no index concept in these two, map is based on key and bean is a POJO where you can retrieve the properties.

For accessing bean you have 2 options.
1.

or

2.

Thats why you have option for array to access the index item , either by using ["0] or [0].
Hi All,
I would like to take a SCJP exam. I don't have any java certication as of now.
What i want to know is before doing SCJP do i need any other java certification or no.

Please let me.

Thanks
Gopal.
Hi All,

I found the problem and i resolved. Instead of overwriting LogoutFilter class, i implemented LogoutHandler and overwrite the method called logout(). That it. And in the XML configuration file add the following code

<bean id="logoutFilter" class="org.acegisecurity.ui.logout.LogoutFilter">
<constructor-arg value="/index.vm"/>
<constructor-arg>
<list>
<ref bean="rememberMeServices"/>
<ref bean="testLogoutHandler"/>
<bean class="org.acegisecurity.ui.logout.SecurityContextLogoutHandler"/>
</list>
</constructor-arg>
<property name="filterProcessesUrl" value="/j_acegi_logout" />
</bean>

<bean id="testLogoutHandler" class="com.somepackagename.somesubpackagename.TestLogoutHandler"/>

thats it. it works fine.
Hi All,
I am using acegi security for login & logout.i want to overwrite LogoutFilter class. bcos i want to do some operation when i logout. I wrote a class also. But the problem is when i start my server not even shows the page but it is automatically calls my UserDefinedLogoutFilter, and it goes like a infinite loop i am unable to do anything, i want to call this class only when i logout, do you have any idea why it is happening like this. I wrote another class for AuthenticationProcessFilter, that one works fine.it call only when i click login button. only logout creating issue.
HI,
I have a my module resource bundle and common application resource bundle,

i want to use application resource bundle in my module resource bundle.

i dont want to copy those contents from application resource bundle.

so how can i use application resource bundle in my module resource bundle.

is there is any way that i can import ???

please let me know

thanks
Kishan
18 years ago
Hi I am new to unix, and build stuff.

But i need to do nightly build, for that i need to write a shell script which synchronize Perforce repository and do maven stuff and deploy it in the remote server.


can anybody have knowledge on this..

please let me know also.

thanks in advance
GK
18 years ago
Hi All,

I am trying to find a solution for couple of days.

mine is not a legacy database. i am using oracle.

i have a parent and child table . my child table does not have a primary key.

it has only foreign key. So which column you will specify in <id> tag of child hbm file.


i specified foriegn key in <id> tag of child hbm.

like:
<id name="foreignkey" column="FOREIGN_KEY">

and i also tried giving some other column which is in that child table.
<id name="age" column="AGE">
but the result i am getting is wrong.


for example:
i specified foreign key in <id> tag of child hbm. when i execute query for that id.

if there is two records for that id in child table.

when i display iam displaying two rows but the problem is first row printed twice. and the second original row is not showing. it means it overwrite the output with first record.


please if any body know this answer me.


thanks in advance
[ March 28, 2006: Message edited by: Mark Spritzler ]
Hi All,

Is it possible to use query string in JSF??.

like how we pass values in URL when you use JSP's.

" target="_blank">http://localhost:8080/pages/mypage.jsp?id=10[/CODE]


thanks in advance
Gopal
18 years ago
JSF
Hi All,
Do you know, where the implementation of ResultSet, Statement, Connection are done.

In which package those implementation are done??

thanks in advance
Gopal
Hi ,

instead of giving the list values in jsp , you can create a list in your backing bean and you can call that list in your jsf.

it will solve your problem.

for eg:

in backing bean:

variable:
private String eventType;
private static SelectItem[] allEventTypes = new SelectItem[] {
new SelectItem("Select All"),
new SelectItem("first"),
new SelectItem("second")
};

method:
public SelectItem[] getAllEventTypes(){
return allEventTypes;
}

public static void setAllEventTypes(SelectItem[] allEventTypes) {
BackingbeanName.allEventTypes = allEventTypes;
}

getter and setter for eventType also.
in JSP:
<h:selectOneMenu id ="eventType" value="#{formName.eventType}" required="true">
f:selectItems value="#{formName.allEventTypes}"/>
</h:selectOneMenu>


hope this will help.

Gopal
18 years ago
JSF
Hi Gerardo,

I got it. thanks.

what i did was i defined a clearAllValues() method in every backing bean.

Then in Search Menus command link i am calling these method first.
and set the navigation to the userinput page. so when it loads clear all the values and then it loads that search page.

thanks for your help...because of your idea i got this solution.

18 years ago
JSF
Hi Rahul,

yes, you are correct , if the field is readonly then we cant get the value in backing bean of JSF.

so what i did was i used <f:convertDateTime> and i wrote validation method to check the format of the date in my backing bean.

so anyway user can enter the date , if he enter wrong date then it will throw conversion error, if he enters wrong format then my validator method will fire.

to display the message i am using <h:message>

thanks
Gopal
18 years ago
JSF