Sergey Tyulkin

Ranch Hand
+ Follow
since May 10, 2005
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 Sergey Tyulkin

Hi.
I've got web 2 projects with similar functionality, but different target users group. The second project is dependent (that is, has classes which refer to the first project's classes) on the first one. These two projects have to be deployed on different servers. I don't want to expose the first project as a web application on the second server. So i would like to include the first project as utility jar for this purpose. But RAD doesn't allow this (include web projects as utility jars). Is there any possibility to overcome this issue, which will not result in manual build steps (e.g., ant build process, wsadmin scripts etc)?
Thanks in advance for any suggestion
14 years ago
PCDATA is parsed character data. It means, that content marked as #PCDATA will be parsed - i.e. the parser will try to recognize markup in the content. Obviously, if it encounters <item> it woul treat it as an element -item-, but the DTD says, that root element cannot have any nested elements.
Well, we've bought Whizlabs XML Simulator. I run diagnostic exam, and something went wrong. Some questions don't make any sense, and some seemed to be incorrect.
Guys, we pay you money! The money for the tests, not for this nice look & feel!
Later i read some another complaints about Whizlabs, and that they dont pay to much attention to these complaints. Maybe this forum is a better place. Who knows.
Let's look at their "sample questions" article at http://www.whizlabs.com/articles/xml-questions.html:

Question 3:
Which of the following DTDs will successfully validate the XML document below?
<root> <root1/> <root2> root2 data </root2> <root3> root3 data </root3> <root3/> </root>

one of the choices (marked as incorrect one, and it is true)
B.
<!ELEMENT root1 (#PCDATA)>
<!ELEMENT root2 (#PCDATA)>
<!ELEMENT root3 (#PCDATA)>
<!ELEMENT root4 (#PCDATA)>
<!ELEMENT root (root1+,root2+,root3?)+>


But the description is wrong!
"Choice B is incorrect since root4 is not a part of the given XML document, and as per the DTD, at least one instance of the root4 element must be present in any XML document that conforms to the DTD."

In fact, choice B is incorrect because of incorrect number of root3 elements in the source document. Agree?

Ok, that's all for now. I will post some more later, just to let the people know
1) As you know, Servlet specification mostly defines interfaces of components - Request, HttpServletRequest, HttpSession etc. And container itself has implementations of these interfaces. We can't know for sure, how it implements them, but we can imagine something like this (for example, HttpSession)
a) HttpSession implementation class has a map of listeners
b) when something happens (for example, user calls session.setAttribute), there is an iteration through this map, that calls appropriate method of each listener.
If you want to know the details, you can look in some open source servlet container, for example, Tomcat.
The return value of doStartTag() doesn't depend on body-content value of the tag. So the answer is Yes.
I have 2 suggestions:
1) Container uses non-validating xml parser.
2) Container uses PUBLIC uri, and uses more appropriate DTD, or even schema to parse the file.
Did you define CATALINA_HOME enviroment variable?
Servlet specification 2.4 (used in 310-081 exam) says:
sessionDestroyed
notification that a session is about to be invalidated

So, the correct answer is B. I think, you have a question from the previous exam.
You can call servlets by their servlet-name using proprietary mechanisms. For example, Tomcat 4 somewhen had an option to call servlets by their names, with /servlets/ prefix in the url
1) Don't know. I think, you can test it yourself, and post the answer
2) In this case, logical path will be the same, as physical path, and you will constrain the beer.jsp, indeed. Note: you can define a servlet, mapped to JSP file, and then define a new path to you jsp in servlet-mapping.
3) This security-constraint will constrain both, servlet and jsp. http-method has no impact on the answer (except constraining only calls, made with this method)
4) If you define auth-constraint, the the user must be authentificated, before accessing this resource. And user's role must be one, of the defined in the DD. If you have no auth-constraint, than user can be unauthentificated at all
5) I think, you can use BASIC, FORM and DIGEST authentification methods with CONFIDENTIAL transport-guarantee. And possibly CLIENT_CERT too. Because authentification methods is a method to authentificate a user, and transport-guarantee is a method to transport data betwen client and server.
BodyTagSupport allows manipulating the content of evaluating tag body. If you use TagSupport, evaluated body is placed to the page, and the user can do nothing with this. When using BodyTagSupport, the user can pick evaluated body from the buffer (BodyContent object) and transform it according his needs.
Usually those scopes represented as HashMap objects. Request scope stored in ServletRequest interface implementation, page scope - in the JspPage implementation class (automatically generated by servlet container). Application and Session scope attributes are also stored in appropriate obkjects - ServletContext and HttpSession.
For the first question, answer is:
There qill be a runtime error, when you try to return BodyTag.EVAL_BODY_BUFFERED, as this value is not alloed to return from IterationTag methods. BTW, there will be no compilation or validation errors, as doStartTag must return int value, and BodyTag.EVAL_BODY_BUFFERED is an ordinal int value.
Yeah, you're right. I get the question wrong. initParam implicit object is used to get ServletContext's init parameters, not servlets.
We can get ServletConfig by ${pageContext.servletConfig} but there is no way to get init parameter from ServletConfig, as we can't get method getInitParameter(String name) from EL expression.
I must say, that i would also like to see the approach for getting JSP init parameters.