Jump to content

vijay1440

Members
  • Posts

    25
  • Joined

  • Last visited

Posts posted by vijay1440

  1. Hi!I want to know how the session handling is done in HTTP in a detailed way. About the way in which the Cookies are used, i am a bit familiar about. But i want to know how the session handling is done in the remaining ways. I want also to know what will be the Web-browser's role in maintaining the user's sessions. What the data that the browser will send to the web-server in order to maintain the user session.Thanks much for any help,Vijay

  2. Hi fnds! I want to know how to get a prompt msg in the web pages (just the way many password protected sites do) for username and password. I read that if I set the response headers likeresponse.setHeader("WWW-Authenticate", "BASIC realm=\"executives\"");i will get the effect i need.But it is not working. So please tell me the way i can do that.Any advice is appriciated.Thanks,Vijay

  3. :) please help me to get connection pooling in tomcat5.0

    Hi! go to the URL http://LocalHost:8080/admin (IF 8080 is ur port)and login using the admin username and password(which are set at the time of installing Tomcat).And then u can have a split screen.The left part contains a tree structure where in u select CONTEXT:LOCALHOST and select ur application.On selecting ur applicatoin u can have "DataSources" option.Click on that , U get a screen in the right part wherein u can set the driver class, number of connections..etc.Bye,Vijay
  4. Hi fnds! I am using com.oreilly.servlet.MultipartRequest class to get the uploaded files from the client. But the problem I am facing is that whenever a big file is uploaded the POST method's limit on amout of data is stopping me to send.Please tell me if I can overcome this problem atleast to some extent.And also plz let me know is there a built-in mechanism in the Servlet Technology itself meant for file uploads.Any suggestion is heartfully thanked.Regards,Vijay

  5. Well,I saw this kind code somewhere,but I can't remember where,so I decided ask.I want that,when tries close window,function happens.Like,alert "Bye,bye!" orprompt,"are you sure?"Something like this.I have seen this in some sites in web.Thanks for help!

    hi! i think it works<body onUnload="confirmOnce()"><script language=javascript>function confirmOnce(){ if (window.event.clientX<0 && window.event.clientY<0) { alert("Bye Bye"); }}
  6. I'm sure theres a number of different ways you could do this. The first idea that jumps to mind is to create a div which contains the question and form elements which you want to optionally display. Give this div an id attribute and set its style so display="none" to make it invisible. Then write a javascript function which is called onchange of the form element it is dependent upon. This function will need to check the answer to that question by retrieving the value and comparing it to your expected result. Based on whether that answer was correct or not, you'll need to dynamically change the div's style so display="block" to make the div visible.
    var elem = "divId";document.getElementById(elem).style.display="block";

    Once you've got it working, you'll probably want to make it slightly more generic so you can reuse the same JS function to make other new questions appear. Probably by passing in the id of the div to display as a parameter to the function when it's called.Hopefully that's at least slightly helpful! But say if you need any of it in more detail.

    Hi! try out this. if ur button is a radio button as follows,<INPUT type="radio" > , add an event handler for that button as<INPUT type="RADIO" onclick="f()">and the defination of the function f() is,function f(){ document.urForm.submit();}********thats itand the prerequesite is that u have to have a form which u want to submit 'urForm'Bye
  7. Hi guys,On my site, I'm using both non-secured and secured (http:// and https://)protocols for the web pages.I have two types of pages one is the content page which can be viewed either in secure or not and the other is the registration page which is strictly to be accessed using secured.I have one registration page which opens on a pop-up window but it is lauched on a content page. So the content page is in non-secure and the pop-up registration page is in secure. On the pop-up registration page, there's a link which uses opener.document.location("URL linking to the content page"). But once I clicked on the link I got javascript error "Access Denied". I tried changing the code opener.location("URL linking to the content page") which obviously I just removed the .document and it works!. But the whole process is working when the content page is in secure then launched the pop-up registration form.I just want to know why when using the opener.document.location("URL") is having erros. Is there security issues when the parent and the pop-up window differs on protocols.Thanks,Jeck

    hi! i dont know much about the secure and non-secure connections(http:// and https://).But I think it is wrong to write opener.document.location = 'some URL';and it is correct to write opener.location = 'some URL'plz try it once
  8. HI,I'm not exactly following what you are saying or asking, but I can clarify that a web service, specifically, is stateless.  So you will not be able to instantiate a session variable through a web service.  What the web service can do is collect information from any number of places and then pass it to a server scripted pages (like, php, asp, or cold fusion) which can then create variables in the session scope.

    first of all, thank u. my dount is as follows... can we avoid the HttpSession object's usage completely with the usage of the Stateful session beans? if s how?thanks much,vijay
  9. Hi! plz tell me the mechanism to maintain the session tracking of a HTTP client with Stateful session beans.I am with an opinion that eventhough it is a stateful session bean,I need to put the data that whatever i need to track of ,into that bean (using some methods)and after that I need to place that stateful sesion bean into the HTTP Session object just like any object. So i doubt that there is no meaning for the Stateful Session bean without the HTTPSessoin object. I also have so many doubts but i can be cleared only after these doubts are cleared.Please clarify my doubts,Thanks much,Vijay

  10. Hi all! I have a small Application in which I need to insert an image into the Oracle 8i Database Blob Column and later I need to send that image to the Browser from a jsp.When the same code which i am putting below is executed in the stand alone programs, it is workig fine.But i am not getting the Image in the right format later due to which the Image is not opened.This is my code snippet in the stand-alone java file to insert the image.This same Image which is inserted with this prog is retrieved well with another stand alone java prog.And I am using a Type 4 jdbc driver*******************************Statement stmt = con.createStatement(); File file = new File("c:\\image1.gif"); FileInputStream fin = new FileInputStream(file); stmt.execute("INSERT INTO testimages VALUES(empty_blob())"); con.commit(); ResultSet rs = stmt.executeQuery("SELECT image FROM testimages FOR UPDATE"); while (rs.next()) { oracle.sql.BLOB blob = (oracle.sql.BLOB)rs.getBlob(1); OutputStream out = blob.getBinaryOutputStream(); int i; while ((i=fin.read())!=-1) { out.write((char)i); } out.close(); } con.commit();******************and my jsp code snippet isresponse.setContentType("multipart/form-data"); response.setHeader("Content-Disposition" , "attachment;fileName:image1.gif); java.sql.Statement stmt = con.createStatement(); java.sql.ResultSet rs = stmt.execteQuery("SELECT image FROM testimages"); while (rs.next()) { java.io.InputStream in = rs.getBinaryStream(1); int i; while ( (i=in.read()!=-1) { out.write((char)i); } } out.close(); %>Thanks a lot,VijayPlease solve my problem.

  11. Thank you very much Manoj!Regards ,Vijay

    Dear Vijay In Html in real we don`t have anything called Menus. Rather we use the <div> or<layer> element itself as menus and use their visibility attribute for this reason.Below I am Providing you a sample code may be this may help you create one. If need more help please do mail me at manoj.dubey@hcl.inThe below code I have used to display a color menu inside a select box.You can customize it as per your needWith RegardsManoj DubeySample code<style type="text/css">#dropmenudiv{position:absolute;border:1px solid black;border-bottom-width: 0;font:normal 8px Verdana;line-height:10px;z-index:100;}#dropmenudiv a{width: 100%;display: block;text-indent: 3px;border-bottom: 1px solid black;padding: 1px 0;text-decoration: none;font-weight: bold;}#dropmenudiv a:hover{ /*hover background color*/background-color: yellow;}.red{background-color:red;}.green{background-color:green;}.blue{background-color:blue;}.yellow{background-color:yellow;}</style><script type="text/javascript">/************************************************ AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)* This notice MUST stay intact for legal use* Visit [url="http://www.dynamicdrive.com/"]http://www.dynamicdrive.com/[/url] for full source code***********************************************///Contents for menu 1var menu1=new Array()menu1[0]='<input type="button" style=" background-color:yellow;width:80px; font-size:8px;border:0px;" onClick="f1(1)" value="Yellow">'menu1[1]='<input type="button" style=" background-color:Blue;width:80px; font-size:8px;border:0px;" onClick="f1(4)" value="Blue">'menu1[2]='<input type="button" style=" background-color:green;width:80px; font-size:8px;border:0px;" onClick="f1(2)" value="green">'menu1[3]='<input type="button" style=" background-color:red;width:80px; font-size:8px; border:0px;" onClick="f1(3)" value="red">'  var menuwidth='10px' //default menu widthvar menubgcolor='lightyellow'  //menu bgcolorvar disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)var hidemenu_onclick="yes" //hide menu when user clicks within menu?/////No further editting neededvar ie4=document.allvar ns6=document.getElementById&&!document.allif (ie4||ns6)document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')function f1(val){	if(val==3)  document.forms[0].t1.className='red';	else if(val==1)  document.forms[0].t1.className='yellow';	else if(val==4)  document.forms[0].t1.className='blue';	else if(val==2)  document.forms[0].t1.className='green';}function getposOffset(what, offsettype){var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;var parentEl=what.offsetParent;while (parentEl!=null){totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;parentEl=parentEl.offsetParent;}return totaloffset;}function showhide(obj, e, visible, hidden, menuwidth){if (ie4||ns6)dropmenuobj.style.left=dropmenuobj.style.top=-500if (menuwidth!=""){ dropmenuobj.widthobj=dropmenuobj.styledropmenuobj.widthobj.width=menuwidth}if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")obj.visibility=visibleelse if (e.type=="click")obj.visibility=hidden}function iecompattest(){return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body}function clearbrowseredge(obj, whichedge){var edgeoffset=0if (whichedge=="rightedge"){var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15dropmenuobj.contentmeasure=dropmenuobj.offsetWidthif (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth}else{var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffsetvar windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18dropmenuobj.contentmeasure=dropmenuobj.offsetHeightif (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeightif ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge}}return edgeoffset}function populatemenu(what){if (ie4||ns6)dropmenuobj.innerHTML=what.join("")}function dropdownmenu(obj, e, menucontents, menuwidth){if (window.event) event.cancelBubble=trueelse if (e.stopPropagation) e.stopPropagation()clearhidemenu()dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudivpopulatemenu(menucontents)if (ie4||ns6){showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)dropmenuobj.x=getposOffset(obj, "left")dropmenuobj.y=getposOffset(obj, "top")dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"}return clickreturnvalue()}function clickreturnvalue(){if (ie4||ns6) return falseelse return true}function contains_ns6(a,  {while (b.parentNode)if ((b = b.parentNode) == a)return true;return false;}function dynamichide(e){if (ie4&&!dropmenuobj.contains(e.toElement))delayhidemenu()else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))delayhidemenu()}function hidemenu(e){if (typeof dropmenuobj!="undefined"){if (ie4||ns6)dropmenuobj.style.visibility="hidden"}}function delayhidemenu(){if (ie4||ns6)delayhide=setTimeout("hidemenu()",disappeardelay)}function clearhidemenu(){if (typeof delayhide!="undefined")clearTimeout(delayhide)}if (hidemenu_onclick=="yes")document.onclick=hidemenu</script></HEAD><BODY><input type="button" readOnly name="t1"  style="font-family: Tahoma; font-size: 8px; border-style:ridge; font-weight: normal; width:80px; border-color: #FFFFFF;"onClick="dropdownmenu(this, event, menu1, '80px'),document.forms[0].t1.focus();"> </body>

×
×
  • Create New...