suri jagadish

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

Recent posts by suri jagadish

Hi,

You can load the properties file just like this and store the properties object as the context attribute. Now retrieve the properties object into your servlet and then get your property as props.getProperty("") thats all. so that you don't need to loop thorough to set the properties.

InputStream inputStream = getServletContext().getResourceAsStream("/WEB-INF/app.properties");
Properties props = new Properties();
props.load(inputStream);
16 years ago
Hi,

If you really want to do it using the servlets then why don't you use the context Listener. This listener is called when the context is started or reloaded etc.
16 years ago
Hi Bear,

Well you are right its not a good practice. I Myself don't code that way.
But i was only trying to establish a fact.
[ April 03, 2008: Message edited by: suri jagadish ]
16 years ago
Hi David,

I think you need to check back on what you have said about the servlets.

It is not absolutely necessary for a servlet to be in a package.

It can exist independently without a package and can be called.
16 years ago
Hi Arjun,

You are right with regards to the mapping in the web.xml.

<servlet>
<servlet-name>HelloWorld</servlet-name> HelloWorld is the java file name
<servlet-class>Users.Ravi.Desktop.CurrentProject.Servlets.HelloWorld</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>HelloWorld</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>

but the only problem is url which you are using to call the servlet. it should be in the following way

http://localhost:8080/HelloWorld/hello

in the above URL you have different parts which are necessary.

http://<servername>:<port>/<context name>/<url-pattern or the name of the jsp>

The context name is the name of the folder of your application in the webapps directory of the tomcat.
16 years ago
Hi Merrill,

you are right i also came to know that it is not possible to use the struts html tags without the struts framework.

Thanks for all of you who have answered....
16 years ago
Hi,
what do you mean by static presentations only?
my requirement is that i need the html:select which automatically selects a particular value from the options, which we pass into the tag.
16 years ago
Hi,

Thanks for the reply. But i mentioned very clearly that i don't want to use the struts framework. i.e No Action Classes, no struts-config.xml nothing.
i only want to use the tag libraries. I had put the struts.jar in the WEB-INF/lib but iam not able to use those taglibs since it insists in the ActionMappings not found...
16 years ago
Hi ,
I am developing a web application which does not use the struts framework but i want to use the tag libraries that are provided by struts. like the html tags etc. can some body help me in providing the information about what are the jar files that i have to use.
16 years ago
what do you mean by session refresh. when you refresh the page it submits to the same session but the same information is sent to the server. The solution to this is the page that you are trying to display should be displayed using the response.sendRedirect() instead of request.getRequestDispacther().forward() so that when there is a refresh it will only ask for that page without submitting any data.

Hope iam clear. if you can provide me with how you are navigating then i will be able to explain in more detail.
16 years ago
you can use you gmail account and send mails using your login and password details. but beware of the proxy, if you have one then you need to include that also in the properties.

mail.google.com
16 years ago
Hi,

The first thing you need to do is the make the method that will prepare the URL static so that your servlet can call that method and pass the sessionID as parameter to that method and that will return the URL.
16 years ago
hi all

i have a file which already has some data in it. i neeed to add more data at the end of that file.please help

thank u
regards
jagadish
18 years ago
hi all
the request dispatcher method does not work it gives an illegeal state exception .

coming to the first solution what yu have said is correct but the request is same as the request because of the first call but i want a solution for this redirection

please help this is very much necessary for my application

thanking u
regards
jagadish.suri
19 years ago
JSP
hi all
i have asked this question previously but the solution is not working .
the question is about rediretion form with in the jsp page.

page1.jsp

<form action="page2.jsp">
<input type="hidden" name="source" value="test">
</form>

page2.jsp

<%
if(request.getParameter("source")==null))
{
response.sendRedirect("page1.jsp");
}
%>

after the form is submitted form the page1.jsp it comes to page2.jsp here after the page2.jsp is realised if we refresh the page the request parameter will be null and the page has to be redirected to the page1.jsp this scriplet is present in the page2.jsp this solution is not working .the functionality that i want is after coming to page2.jsp if we refresh the page it should be redirected to the page1.jsp

thanku
regards
jagadish
19 years ago
JSP