Alexan Kahkejian

Ranch Hand
+ Follow
since Apr 30, 2003
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 Alexan Kahkejian

Thank you Scott for your wishes. and thank you for your advice, I will take it into consideration.
17 years ago
I would like to announce the launch of my site: http://www.javaemployer.com which I am trying to make it the bridge between java programmers and employers seeking java experts.

Please visit my site for full information and post any comments or suggestions in the public forum at: http://www.javaemployer.com/forum

I am committed to make this site one of the most useful java employment tools, so any ideas to improve it are so much appreciated.

P S : Registration is free for both employers and jobseekers.
17 years ago

Originally posted by sreenath reddy:
hi alex

U hadnt metioned whether u had given scope="request" for the form bean asscoaited with ur form bean in ur struts-config.xml



Yes, and that is why I feel confused
17 years ago

Originally posted by Marc Peabody:
Try putting this in your struts-config.xml:
<controller locale="false"></controller>

That's the only thing I can think of. That and maybe making sure that the ActionMapping's scope is also request.



Thanks for your suggestion but it didn't worked


Originally posted by sreenath reddy:

Hi alexander

I feel the problem with ur code is that u have a form with some action and that might be having some action form assocaited with it and in the config file u might not have given the scope for this action mapping......then that will be in session scope so make it request

and one more thing thats not the way u need to hanlde the session issues ...write some custom tag r else inside that login resent instead of invalidating the session just redirect to some page saying session is invalid and from there just direct to the login page of ur application ..its not a good practice to do like this

r else better u can use checklogontag to handle these issues



I am using ServletFilter to check login but in this code I am only trying to prevent the attachment of sessionid parameter to the links (when cookies are disabled) to allow search engines to index that pages because most SE's don't index pages that have sessionid parameter in the links.

Thanks
[ September 21, 2004: Message edited by: Alexan Kahkejian ]
17 years ago
Glad that helped.

As for html:base look for documentation here (so simple)

http://struts.apache.org/userGuide/struts-html.html#base
17 years ago
Hi

Try putting <html:base/> in the head tag.

if you post the jsp we can help you better
17 years ago
Hi

I recommend "Struts in Action" by Ted Husted.

And of course don't forget the struts documentation it's very useful.

Also take a look to book reviews at javaranch bunkhouse

Javaranch Bunkhouse (J2EE)
17 years ago
here is my footer.jsp


There is no getAttribute() on session object. the problem will solve only by removing the <html:form> tag

P S : the form here is fake I am just using it to figure out the cause of the error which occured in other jsp pages.

Thanks
[ September 20, 2004: Message edited by: Alexan Kahkejian ]
17 years ago
Hi all
I am using Struts1.1 with Resin 2.1.12


I am trying to invalidate the session when the visitor is not logged in to prevent sessionid to be attached to the links (for search engine optimization).

The problem is when I have a html:form tag after that it gives me :

[ServletException in:footers/footer.jsp] Can't call getAttribute() when session is no longer valid.'

but I specified the scope in action mapping as "request" not "session", also I tried to add scope attribute to html:form but nothing changed.

So could someone please tell me why he is asking for session object 'getAttribute()'?

thanks in advance
[ September 20, 2004: Message edited by: Alexan Kahkejian ]
17 years ago
Hi all

In my application I implemented this solution to prevent multiple logins from the same user:

In the application scope I store:
a- the user name (key) and sessionID(value).
b- sessionID(key) and an object(value) which is of the following class:


And I have a session listener which removes the values stored in the application scope in the sessionDestroyed method.

So when the user logs in I check if this user name exists in the application scope and if so I get the session id associated with it and finally I retrieve the object associated with sessionID which holds the reference to the real session object and I call invalidate() on it.

After that I insert the (username, sessionID) and (sessionID, Reference) to the application scope.


The problem is that I believe that there are better solutions than this so any ideas are so much appreciated.


P.S. : I am using Struts 1.1

Thanks in advance
17 years ago
Ok I will answer my question:
The key is stored in org.apache.struts.Globals.ERROR_KEY
so this solved my problem


<%@ page import="org.apache.struts.Globals" %>
<logic : present name="<%=Globals.ERROR_KEY%>" scope="request" >
Anything you want to do if there are errors.
</logic : present>


[ May 01, 2004: Message edited by: Alexan Kahkejian ]
18 years ago
Hi all
I want to know the KEY under which struts1.1 validator stores the ActionErrors object in the request scope, so I can check if it is present by <logic : present/> because I am using <html:errors property=""/> beside each field in the form so I want just to report that there are errors in the form header.
Thanks in advance
[ May 01, 2004: Message edited by: Alexan Kahkejian ]
[ May 01, 2004: Message edited by: Alexan Kahkejian ]
18 years ago
Okey it solved.
The problem was the absence of slash in the form name in validation.xml. so it doesn't matched the formname in html:javascript.
18 years ago
Hi all
I subclassed my form from ValidatorActionForm so the server-side validation works but the client side javascript generated is only the following

The javascript tag in the jsp page is as follows:

SO can someone tell me what's wrong with this code or guide me to client-side validation using ValidatorActionForm.
Thanks in advance
18 years ago
Hi Joyce
Thank you for your detailed reply but are you sure that when the fulfillment history shows "Processed" so it is mailed?
Because my SCJP fulfillment shows only "Mailed" which I already recieved after 3 weeks of taking the exam.
But my SCJP was on 12 Aug 2003 and that time the certmanager.net was different.
So may be changing their system caused some confusion.
[ March 11, 2004: Message edited by: Alexan Kahkejian ]
18 years ago