Rahim Vindhani

Greenhorn
+ Follow
since Dec 06, 2005
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 Rahim Vindhani

It is controlled by JVM. It may decide the size of the pool by available memory
15 years ago
Hi All,

I'm developing an application which would require access restriction based on the IP address.

Basically, the JSP page needs to be accessed only by local intranet users. If the request comes from outside local network, the page should not display the content.

Any help, suggestions would be highly appreciated.

Thank you.
16 years ago
JSP
isnt it as simple as



if its more than one time, You can use replaceAll (only JDK 1.4 and later I guess)
16 years ago
Even shorter use,

16 years ago

Originally posted by Albin Joseph:
Since it is a get method , the container will call the doGet() method of the servlet. But it is not overriden in your servlet, the default implementation will get executed and the default implementation for doGet() is 'HTTP 405 message' ( at least in BEA Weblogic).



Yes exactly albin...the default implementaion of the doGet() will be called by the container.

Originally posted by Lucas Sanabio:
The welcome-file-list will be the file which will be called when the user access your application.



You can say it like default files, which container will look for if you havent specified any files in URL.....
18 years ago

Originally posted by Ben Souther:
You can only have one response per request.

One solution is to send the redirect or forward first.
Then put some javascript in the page to which you've forwarded that makes the call to get the download file.



Or else, put a javascript redirection code after downloading.. that will redirect request to another page.
18 years ago

Originally posted by Albin Joseph:
Error page will be invoked and diplayed when an error occured in a JSP page. Every error page must contain an page attribute called isErrorPage="true" and the page where the error or exception occured must tell which is the error page using errorpage="myerropage.jsp"

Fore more info Check this
http://www.imagescript.com/atg/articles/jsp_j2ee/error_page_basics.htm




Actually in JSP, we can delegate the exception to some another page so that it can be reused for multiple exceptions.

So in the exception source page we use errorPage="pageName" attribute to define exception handler page.

And in the exception handler page, we use isErrorPage="true" to indicate that this page is going to handle exceptions.

I think this will answer your question.
18 years ago
JSP

Originally posted by Albin Joseph:
Hi

That is up to the container. You can deploy a folder instead of WAR file in Weblogic and Tomcat. The only thing is that the folder must follow the correct directory structure. If you want to deploy it on some other place or like that , the WAR will be easy to handle I think.

WAR means WEB ARCHIVE. JAR :- JAVA ARCHIVE.
WAR is an Web Aapplication archive and contains JSPs, "normal" static files (HTML, images, etc.), servlets, tag libraries, and such.


JAR is the "normal" Java Aapplication archive, but in this context it usually contains EJBs instead of code libraries or runnable (e.g. from outside an application container) applications




.jar files are simple compressed files. you can put classes inside it.
While .war is also compressed file but it has to follow some directory structure as given below.

WAR file structure -
The static HTML files and JSPs are stored in the top level directory.
The Servlet and related class files must be stored in the WEB-INF/classes directory.
Any auxiliary library JAR files must be stored in the WEB-INF/lib directory.
The deployment descriptor is stored as a file named web.xml in the WEB-INF directory.
18 years ago
JSP

Originally posted by Albin Joseph:
HttpSession by default attempts to store the session in Cookies. So if cookies are disabled you need to use URL rewritting. For this you have two methods in HttpServletResponse. encodeURL and encodeRedirectURL. It will append the jsessionid paramater to your URL. If no encoding is needed it will return the URL unchanged.

you can use it like respons.sendRedirect(response.encodeRedirectURL("myrurl"));



Exactly... but again you need to encode each and every URL of your page. Otherwise this technique wont work.
18 years ago