File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes servlet init parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "servlet init parameters" Watch "servlet init parameters" New topic
Author

servlet init parameters

sourabh kanoongo
Greenhorn

Joined: Nov 23, 2010
Posts: 10
i want to know the use of following in web appl develepment without any framework
1. web.xml
2. context.xml
i need help.please
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
web.xml: see the servlet specification - it explains everything that's in that file

context.xml: see the Tomcat documentation
sourabh kanoongo
Greenhorn

Joined: Nov 23, 2010
Posts: 10
thank you
sourabh kanoongo
Greenhorn

Joined: Nov 23, 2010
Posts: 10
actually i am using NetBeans 6.5 IDE in my web based projects. whatever i make (servlet or jsp ), in my web.xml there i found a new entry for servlet.
but i still confused that what is the actual use of this two xml files.how can i utilize these files?, can we customize these files?if yes then why and how???
please guide me...
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31052
    
162

In a nutshell:
The web.xml is for application configuration. The context.xml is for environment configuration.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Atul Darne
Ranch Hand

Joined: Jul 05, 2009
Posts: 118

Jeanne Boyarsky wrote:In a nutshell:
The web.xml is for application configuration. The context.xml is for environment configuration.



context.xml is the environment file made by the Netbeans IDE and varies from project to project, basically it has all links and configuration needed for eachtime you reload the project in netBeans


Regards, Atul.
I came to this world on a Learner's License
sourabh kanoongo
Greenhorn

Joined: Nov 23, 2010
Posts: 10
thanks Atul
sourabh kanoongo
Greenhorn

Joined: Nov 23, 2010
Posts: 10
i am developing a small simple project in struts framework.
in which a accept a roll no from user and display result..
for displaying i have two jsp(pass.jsp and fail.jsp)
one struts action (ResultGenAction.java)
one strutsformBean(ResultGenBean.java)
bean fetches marks from database acctording to rollno given be user and sends a boolean value true and false showing pass or fail.
if pass then view should be pass.jsp.
if fail then view should be fail.jsp.
i have made forward entries in struts-config file..
as:-
<action input="/" name="ResultGenBean" path="/EnterRoll.jsp" scope="request" type="Result.ResultGenAction" validate="false">
<forward name="p" path="/WEB-INF/pass.jsp"/>
<forward name="f" path="/WEB-INF/fail.jsp"/>
</action>

when i enter roll no for example 101 which is available in database and it is pass,but i get a blank response instead of a full marksheet through pass.jsp
same for all roll nos....it is not working

please help me in sorting out this problem..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61753
    
  67

Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8994
    
    9

sourabh kanoongo wrote:
<forward name="p" path="/WEB-INF/pass.jsp"/>
<forward name="f" path="/WEB-INF/fail.jsp"/>


Any path under WEB-INF is inaccessible to external web browsers. This is why it is a secure place for us to put our configuration files, class files and library dependencies.


[How To Ask Questions On JavaRanch]
sourabh kanoongo
Greenhorn

Joined: Nov 23, 2010
Posts: 10
it was my mistake,i will take care of choosing the proper forum in future ...
sorry
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet init parameters