Priya Viswam

Ranch Hand
+ Follow
since Dec 28, 2006
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 Priya Viswam

Eventhough protected.jsp is a constrained resource, the web application can
access it. Only the clients who are not manager's can't access it. Since there
is no constraints for the unprotected.jsp, it will work properly.
You have to create "Myproject/WEB-INF" under the webapps directory. Place your web.xml file in the WEB-INF folder.
About 6.6) Configuring to use tag libraries
http://www.examulator.com/moodle/mod/resource/view.php?id=382

1. Compile this class and place it in the directory
WEB-INF\classes\com.examulator
It should be
WEB-INF\classes\com\examulator

2. When you request this page it should generate the output
HelloWorld
-> it should be Hello, world.

3. <%@ taglib uri="WEB-INF/taglib.tld" prefix="h" %>
-> <%@ taglib uri="WEB-INF/TagDemo.tld" prefix="h" %>

4. The javax.servlet.jsp.tagext.TagSupport allows the creation of custom tags
-> The javax.servlet.jsp.tagext.BodyTagSupport allows the creation of custom tags

5. If el-ignored was set to true in web.xml but isElIgnored was true in the jsp
-> If el-ignored was set to true in web.xml but isELIgnored was true in the jsp
[ May 10, 2007: Message edited by: Priya Viswam ]
About 6.5) JSP implicit objects
http://www.examulator.com/moodle/mod/resource/view.php?id=381

1. The request implicit object is an instance of HTTPServletRequest, and response is an instance of HTTPServletResponse objects.
It should be
The request implicit object is an instance of HttpServletRequest, and response is an instance of HttpServletResponse objects.

2. <% request.getQueryString() %>
It should be
<%= request.getQueryString() %>

3. The exception implicit object is of type
java.langThrowable
- Dot missing. java.lang.Throwable

Another doubt is that in a jsp page, how can I get a hold of the jsp implicit objects in the methods I write using jsp declarations??



implicit objects are not available in the methods that you write using jsp declarations.
About 6.3) JSP with XML tags
http://www.examulator.com/moodle/mod/resource/view.php?id=379

1. <%@ page import=�java.util.*,java.io.*� %>
The xml equivalent tag is
<jsp:directive.page language="java.util.*"/>

->
The xml equivalent tag is
<jsp:directive.page import="java.util.*, java.io.*"/>

2. <:jsp:expression
remove the colon before jsp

3. The reason for this is so that the less than symbol < does not get interpreted as the start of the closure of the <js:scriptlet tag
The letter p is missing in <jsp:scriplet tag

4. <jsp:directive.directive
Either remove the second directive or change it to directivetext

5. <%@ page errorPage="errorPage" %>
-> <%@ page errorPage="errorPage.jsp" %>

6. Unfortunately it does not quite work quite correctly -> an extra �quite�
About 6.2) JSP Directives

http://www.examulator.com/moodle/mod/resource/view.php?id=378

1. The headings �Import�, �IsELIgnored�, �Include� and �Taglib� starts with capital letters, where as �session� and �contentType� starts with small letters.

2. <%@ page import=�java.util.*,java.io.*� %>
The xml equivalent tag is
<jsp:directive.page language="java.util.*"/>

xml equivalent should be
<jsp:directive.page import="java.util.*,java.io.*"/>

3. MIME originally stood for Multipurpose Internet mail extensions ->
MIME originally stood for Multipurpose Internet Mail Extensions

4. Java Standard Tag Library (JSTL) --> JSP Standard Tag Library (JSTL)

[ May 10, 2007: Message edited by: Priya Viswam ]

[ May 10, 2007: Message edited by: Priya Viswam ]

[ May 10, 2007: Message edited by: Priya Viswam ]
[ May 10, 2007: Message edited by: Priya Viswam ]
About 6.1) JSP Elementshttp://www.examulator.com/moodle/mod/resource/view.php?id=377

Under the heading "The include directive"
1. <% @include file=�menu.jsp� %>
There should not be any space bet <% and @

2. <jsp: include page=�menu.jsp� />
There should not be any space bet <jsp: and include


3. The include directive happens at translation time (i.e. The very first time your jsp page is called the code gets written to a servlet) and the include directive happens each time at runtime.

include directive happens each time at runtime -> include action happens each time at runtime

4. Under the heading �JSP Declarations
If you want to create new methods within the output service or to create fields (class level variables) you add an exclamation mark (!) after the percentage symbol and that acts as what is called a declaration.

�within the output service� that part is not clear.
Did you specify <security-constraint> in the DD?
Please check page 632.
On the top of the page there is a diagram showing -

Diane is both a Member and Guest.
Annie is an Admin, a Member and a Guest.
Ted is a Guest.

As per the auth-constraint, only Guest can access the application. Here all the 3 people are having the Guest role. This might be the reason why it is mentioned that all the users can access the webapp.
You can configure mime types in tomcat. Please check the file web.xml in the conf folder of tomcat.
The pathname must begin with a "/".

so change
RequestDispatcher dis = sc.getRequestDispatcher("menu.jsp");

this to
RequestDispatcher dis = sc.getRequestDispatcher("/menu.jsp");

and it will work.
Please provide the source code for B.java
In the example you quoted , sourcepath doesn't have any role as it is not referring to any other java files.

If A.java have any reference to other java file which is placed in some other directory, we can use sourcepath to specifiy where to find the referenced file.


for eg:


Here A.java is referencing Test class which is located in C:\src\second\Test.java. We can compile A.java file using the command

C:\src>javac -sourcepath . b\A.java
Source path is used to tell the compiler where to find sources it needs that aren't specified on the command line.


http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4984204