Pakna Zed

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

Recent posts by Pakna Zed

Dhivya kalidoss wrote:I am creating Jsp web application. I am in need of login page coding. Shall you give me the coding for login page using UseBean Property in JSP especially validation for login page.



Hello, Dhivya.

Incidentally, you can try to re-use some code from here.
14 years ago
JSP
Hello everyone, I am preparing for exam and would ask you some help in clarifying a few issues. But, before anything, some code is inbound first - it's a really simple login example I've constructed.
Let's assume correct username and pass combination is entered; questions are at the bottom.

LoginPage.jsp (entrypoint - view)


LoginServlet.java (controller)


UserDAO.java ("service" class)


UserBean.java (model, a classic POJO/bean used as a DTO)


userLogged.jsp (exitpoint - view) --never mind the div elements, they're there to center the view, but I won't spam you needlessly with CSS, it's irrelevant anyhow--


Webpage output is as follows (c/p directly from FireFox):
Welcome, USER_X
********
Test 0 ->
Test 1 ->
Test 2 ->
Test 3 ->
Test 4 ->
Test 5 ->
Test 6 -> USER_X
*******
Test 7 -> localhost:8080
Test 8 -> localhost:8080
Test 9 -> GET


1) My first question is regarding the scope - which scope is actually applicable?? If you checkout userLogged.jsp, lines 13 and 22, you'll see my dilemma - if I use any other scope than "application" in L13, line 14 returns null value. On the other hand, should I use applicationScope on L22, it returns null (as it damn well should, since I am setting a SESSION attribute, not a context attribute!).
So, the question is - why should I use application scope on L13 anyway?? I'd expect nothing other than session scope, as can be seen from my controller.

2) The other question is regarding EL - why can't I fetch request parameters in Tests 0-5? Other stuff works fine (as can be seen from output), but I can't understand how to make these request parameters printed out as I inteded (via request EL implicit objects).

Thank you very much in advance
14 years ago
JSP
Hello everyone, here's a greenhorn in need of advice.

Recently, I've come up on a situation where I should compare two XMLs but in a somewhat non-standard way, so let me briefly describe the current specification.

Consider two XMLs, A and B.
Let us denote A a "comparison XML" and B a "reference XML".

The comparison C that I need to construct is basically described with relation C = A ⊆B, and it should return a boolean operator: true for case when C holds, and false otherwise. So, the way I see it - whenever I find a node in A that is not in B, or is "semantically-different" from reference node in B, we should return false and terminate immediately.

Let me give a brief example:

So, for this case C should return true:

Observe the ordering in B node - if complete ordering inside a node is permutated, we consider it to be "semantically-equivalent" with reference XML.
This case would see C return false:


Also, trivially, C would also return false in this case:

So, since I am very fresh with XMLUtil (I discovered it just yesterday), I would basically need a few pointers (pardon me, references ) from people knowledgeable with XMLUtil API:
- what interfaces should I override? First MatchTracker comes to mind with its methods matchFound() and printNode() (it would be nice to see where A differs on B, but it's not mandatory),
- if possible, guesstimate how much work and implementation would this ensue? More specifically, would I be better off constructing the algorithm myself if it would take too much time to fiddle with API (DifferenceEngine) in order to get this thing done?

Also, great help would be to make XMLUtil perform comparisons one-way only, i.e. to report differences in direction A -> B, not the other way around.

Any other insight regarding this is also appreaciated.

Thank you very much for your time.
15 years ago
Welcome mr. Walls, it is great to have you here!
15 years ago