Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Amrit pandey

Greenhorn
+ Follow
since Jun 28, 2010
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 Amrit pandey

To understand the difference between <jsp:invoke> and <jsp:doBody> , we must first understand what is fragment:

============================================================================================================================================
JSP Fragment :

JSP Fragments is a new feature of JSP 2.0 that allows page authors to create custom action fragments that can be invoked. It allows a portion of JSP code to be encapsulated into a Java object that can be passed around and evaluated zero or more times. Template text and expression evaluations can be included in JSP fragments.

============================================================================================================================================

There can be more than one fragment for a JSP page. If we notice carefully, we will find that invoke has a required attribute called "fragment", whereas doBody has not.

Hence , <jsp:doBody> operates only on the body of the tag instead of a specific fragment (as it does not have "fragment" attribute to operate on a particular fragment )

"specific fragment passed as an attribute" means the specific fragment out of many more fragments in the JSP page on which <jsp:invoke> has to be applied.


Hope it might have clarified some of your doubts, feel free to share if you have any more question on this,


Thanks

Amrit Pandey
9 years ago
JSP
Hi Ulf /Muhammad,
Thanks for your prompt replies.. First of all sorry for mentioning the wrong header (accept ) .

Yes we are using web service , but assumption is to use REST instead of SOAP.

Idea is that if s consumer is not trusted I.e application does not know what kind of consumer it is then user credential will be passed in the HTTP HEADER. Which will be intercepted by Apache CXF interceptor for the authentication.

Would like to hear from you guys on this .
Thanks
Amrit Pandey
9 years ago
Hi,
I am new to web services and came to a scenario where user credentials are being proposed to be passed through HTTP Accept header. The scenario is:

1> consumer requests for a resource
2> Request comes to a Facade layer of the application
3> the layer validates whether the consumer is trusted or not. This is done through a config file which contains the information of a list of trusted user.
4> if the consumer is not trusted , the username & password is passed in a HTTP Header , later an interceptor intercepts the request , fetches the information in header and calls further service to authenticate the consumer..

Waiting for some prompt reply..
Thanks in advance!!
Amrit Pandey
9 years ago
Again, we will have to use JavaScript methods to disable / filter specific mouse events/ keyboard events based on the requirement ..

E.g
==============================
<script language="JavaScript">
Document.onmousedown=disableclick;
Status= "Right Click Disabled";

Function disableclick(e)
{
if(e.button==2)
{
Return false;
}
}
==============================

For more information , Please refer following URL :
Http://www.hypergurl.com/norightclick.html



Thanks ,
Amrit Pandey
9 years ago
Hi Bhavesh,
To answer your question on disabling the back button of the browser : "Yes!!! We can disable the browser back button, infact it is very common especially in Banking website where security is a major concern".

In the most simplest way. It can be achieved by using JavaScript function . The function causes every BACK request to return FORWARD.

========= Code sample=============
if(window.history)
{
window.history.forward(1);
}
================================

Again , you need to pay special attention on browser compatibility when you are using JavaScript and you are willing to run your application on multiple browser.

Hope this reply is inline to your question.
Thanks,
Amrit Pandey
<Please don't mind formatting of this reply.. I am posting it from my mobile.>
9 years ago
Hi Bhavesh,
Sorry I could not follow the post for last couple of days.. R.Jain has provided very valuable inputs, hope you were able to implement what you wanted!! Good luck..
9 years ago
Thanks a lot Mikalai !!! It was very helpful..
Hi Mikalai,
I am novice to Web Services.. I am also planning for OCEWSD6. It will be extremely helpful if you could guide us by answering following questions

1> What study materials I should refer for the preparation.
2> Is any mock test material available for this exam?
3> How many hours of preparation this exam requires ? [Bear me, this question might sound little awkward, I am asking for a rough estimate ]


HI Bhavesh,
I would suggest you the following logic

1> In session keep three strings, currentPage, previousPage and nextPage where,

currentPage will represent the current view of the application.
Similarly,
previousPage:- Previous view of the application
nextPage:- request to navigate to the next page from the current Page.

2> In your situation I am assuming, based on user's priviledge/access or any other logic which guides the application to allows/dont allow the user to navigate to any particular page.

Let us suppose User object has a method hasAccess() which returns boolean value i.e. TRUE if user has access to perform a particular action and FALSE if user doesnot have the access.

3>Assuming you are having some action method which will be called when actor makes a request to navigate to any page ( say navigateNextPage())

Write following logic in your action method



In this way you can restrict user to navigate to the previous page. Let us know if this logic doesn't make any sense in your scenario.


Thanks,
Amrit Pandey

9 years ago
Hmmmm.... Got your point.. Many many thanks Prabhaharan!! Committing this kind of mistake is a crime...Such a silly mistake!! I changed the URL , now I am not getting that issue but still I am getting other issues related to cglib library. If you see the 1st error log I had posted, was another exception that was being thrown


I updated the build path with "cglib2.2.jar". Later I was getting "asm" related exception which was resolved by updating the build path with the jar "asm-4.0.jar". Now there is a new exception that is thrown when I am trying to run the application. The error trace is:


With further curiosity, I wrote a JDBC program using oracle driver and used the same url what I was putting in hibernate.cfg file. The program was running fine without any exception. Here is the connection I used in my jdbc program [I changed <HOST> value in TNSNAMES.ORA file from "AmritP.nbin.local" to "localhost"]



As the URL in both the places [JDBC program/ hibernate.cfg] are same , can there any problem with loading of "OracleDriver" in hibernate (as we are not using class.forename() explicitly in hibernate- just a guess) ??

Hi Prabharan, thanks for your prompt reply!!

I was not aware of the format you suggested so I googled and found a link [ http://www.orafaq.com/wiki/JDBC ] with relevant information that gave me clue what you meant to convey. Then I came to know about TNSNAMES.ORA file [ link http://www.orafaq.com/wiki/Tnsnames.ora ], when I opened this file I found that I was giving wrong HOST name. Here is the code in TNSNAMES.ORA file

================TNSNAMES.ORA=========================


============================================================

I tried multiple combination for connection.url property but with no luck. I tried below combination:



and


but still getting No suitable driver found for oracle:jdbc:thin:@//AmritP.nbin.local:1521/XE Or No suitable driver found for oracle:jdbc:thin:@AmritP.nbin.local:1521:XE respectively for above two combination.

Please suggest !!
Hi I am new to Hibernate.. I have written my first hibernate program in eclipse but when I am running it its throwing following exception in cosole



Here are the codes for hibernate.cfg and PersonManager.java files:

=================<1> hibernate.cfg.xml======================

==================================================================

2] PersonManager.java file [Person is a Pojo class having getters and setters for its attributed (code not pasting here), PersonManager provides configuration to hibernate and perform DB actions]

================== PersonManager.java===========================


===========================================================

Important:
1> I have added

ojdbc14.jar and other required jar files

in project's build path
2> I am using Oracle 10 G database


Waiting eagerly for your reply.

Thanks in Advance..
Amrit Pandey