Rigel Kentaurus

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

Recent posts by Rigel Kentaurus

Originally posted by K Varun:


Lets hope it will go better only.



Could you elaborate in how to do the customized error messages for fields. Right now I am using a <h:message for="componentId" /> for printing the error message, but I can't find some way to print a non-default jfc message for each textfield
20 years ago
JSF

Originally posted by saran sadaiyappan:
Hi all,
I want the caching facility of the browser to be disabled.i.e even after clicking the back button in the browser he should not be taken back but the message "page expired" to be displayed.Can anyone help me?



Use this code in every servlet:

response.setHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT");
response.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setHeader("Pragma", "no-cache");

No waranty, but the browser is sent the instruction of not storing in the cache that page
20 years ago

Originally posted by sree ram:
hi
say suppose there are two weblogic servers are running.
jsp1 is running on weblogicserver1 and jsp2 is running on weblogic
server2.
how can we communicate jsp1 and jsp2?



1) pass parameteres between them (ie jsp2?param1=x¶m2=y

2) use a database to store temp data
20 years ago
JSP

Originally posted by Priya Singh:
Hi,
I have to decide for a optimal solution.

I have a form, on Submit , it disables the submit button and submit the form again which in turn executes Java code to check if the file exists on server or not.

My problem is, that I want to give a message after teh check is done to the user that the file is found or not found and then do the processing (ve to create file if it doesnt exist) .

I tried it with Java script but it doesnt seem to be a good option.

any suggestions !



Are you sending the complete file to the server? (ie, uploading it?) if this is the case keep in mind that you don't get to the servlet service() until all the file contents are sent by the browser.
20 years ago
JSP

Originally posted by Pinda Ros:
Hello,

I have a form on a web page and when the user clicks on the button of the form the action (part of the form) goes to page X and it passes some parameters.

The page X should forward or redirect to another website using the post method passing these parameters as well.

Ahy suggestions?

Thank you in advance.

pinda




With javascript, in the page X:

<form method="post" action="wherever">
<input type="hidden" name="var" value="value" />
</form>

<script>
document.forms[0].submit();
</script>
20 years ago
JSP

Originally posted by venu navat:
suppose i want my application to be such that , if any action is not done for some stipulated time peroid on any jsp page ,and after that stipulated time if user tries to do some action on that jsp page, he should be taken back to login jsp..... what is the code for this ???



You could set a session timeout, either with the <session-timeout> in the web.xml or with the setMaxInactiveInterval in the servlet/jsp, then if that time the user was inactive then the session expires and any objects in the session are deleted, then you would have to check for your session and if not valid.... goes back to the login
20 years ago
JSP

Originally posted by Dushy Inguva:
Hi,

I want to prevent the user from using bookmarked links to access pages deep in my application.

When a bookmarked link is accessed, my application might throw an error if that page expects to find a previously initialized session scope bean. Yes I am using JSF, but I think this post is more relevant in this forum.

Now, I am trying to write a filter to prevent such occurances. I have a request.getSession().isNew()

The problem is, when a user visits a bookmarked link, the server presents the login form (my filter is never invoked here), by the time the user enters username and password and logs in, the session is already created and the session.isNew() returns with a false.

Is there any way around this?

Thanks,
Dushy



Don't try to control your users.. you can't.

A better approach would be to check for that session object that you need, and if not found redirect the user to the main page, or to the page where that session object is created, then even if the user bookmarks page:
http://yourpage.com/productResults he would be redirected to, say, http://yourpage.com/index, and only after he did the valid navigation you have decided for your site he would be able to enter that second results page.
20 years ago
JSP
I assume you are using HTTP 1.1, and doing several requests in the same connection.

HTTP does not define a limit, but your webserver does, for example apache in its configuration has something about how many requests could be made in the same connection, and how much idle time until he disconnects the client, I have not seen something similar in Orion.

Either way relying on this would be a bad idea since the webserver can change, it would be better if your midlet were smart enough to "reconnect" to the server in the event that his connection has been closed because of too many requests.
20 years ago
If it needs validation... do it in the server. Then do it again in the client just to be polite.

In the server I validate mandatory input, data types, ranges, duplicate information, valid data (are they passing me something that wasn't on the catalog?) almost anything that needs validation.

Then I test and when I am really sure that the server si validating correctly I do the javascript validation for the client, that way he doesn't need a full trip to the server if soemthing goes wrong, the client side validation is a service for my client, but in the event that he had javascript disabled the application would still be secure.
20 years ago
JSP
Hidden form fields are not for session tracking.

We have two mechanism for session tracking, they are cookies and URL rewriting, the latest for the people that doesn't have cookies enabled in their browsers, I could only understand sending a session id in a hidden field when you have your own session tracker and are not using the one that is already with your server container (HttpSession and all), but why re-invent the wheel?

Hidden fields are for passing information between pages, sometimes I use a <input type="hidden" name="action" value="XXX"> and I clearly don't want that information displayed to the user
20 years ago
I don't know why you would like to make an unmutable object mutable or viceversa.. they are really different types that serve different purposes, look at the String and StringBuffer class for example. Maybe extend on what you are trying to do?

One aproach that comes to my mind right now is using the decorator pattern and add some setter methods, you would probably have to keep a reference to the inmutable object and generate a new one each time you make a change.... not really a practical solution if you are looking for performance but it would work.

And about making a mutable object inmutable... that's easier, just subclass it and override all the setter methods (or anything that modifies the object) to throw an UnsupportedException or something like that
20 years ago