Jump to content
xisto Community

Ola Daniel

Members
  • Content Count

    15
  • Joined

  • Last visited

Posts posted by Ola Daniel


  1. When I'd joined this place - it sure used to offer Tomcat support, which meant you could host JSP sites. Am not so sure if it has been cut out - but just gimme a day to find it out. Only OpaQue can tell me for sure and he's gone AWOL again

    Well, in the main page, they say that it supports JSP pages. Well, this is the main reason that I have come to here. If it can't, then I guess I'll have to find another Free Java Server. :unsure:


    Like luizzerros says the JSP support offered on the main page was what attracted me here. I hope the Tomcat support still exists. Ill patiently wait for yu to find out from Opaque.

    Thanks.

  2. I'm making a Firefox extension, and I need to use the POST method, which apparently is almost exclusively for HTML. Writing Firefox extensions is just like creating a web page, but the only difference is that you should avoid using HTML at all. Javascript, XML, etc. are fine. I've tried using the XMLHttpRequest function with AJAX, but I couldn't get it to work. So does anyone know how to POST information using any language but HTML? (Not GET. But it'd be much easier if I could use GET.)


    Im not really sure i get what yu want to do... but this might help. I use AJAX to submit my form using the Post method. Heres my code:

    function AJAXInteraction(url, callback) {	var req = init();	req.onreadystatechange = processRequest;			function init() {	  if (window.XMLHttpRequest) {		return new XMLHttpRequest();	  } else if (window.ActiveXObject) {		  return new ActiveXObject("Microsoft.XMLHTTP");	  }	}		function processRequest () {	  // readyState of 4 signifies request is complete	  if (req.readyState == 4) {		// status of 200 signifies sucessful HTTP call		if (req.status == 200) {		  if (callback) callback(req.responseXML);		}	  }	}	this.doGet = function() {	  req.open("GET", url, true);	  req.send(null);	}		this.doPost = function(str) {	  req.open("POST",url,true);	  req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");	  req.send(str);	}}

    And I use it like this:
    var url = "/MyServlet";var querystr = "opt=NBCA&optionx=APPROVE&date_created=${param.date_created}";var ajax = new AJAXInteraction(url, approveResponse);			ajax.doPost(querystr);


    You should be able to adapt this to suit your needs :(

  3. In addition to what the other guys have said MySQL is a very easy database to use unless of course you have no database back groud at all.To create a database:create database myDb;To create tablesCREATE TABLE `account01` ( `ACCOUNT_NO` bigint(20) NOT NULL auto_increment, `account_id` varchar(255) default NULL, `accountname` varchar(255) default NULL, `emailAddress` varchar(255) default NULL, `DATE_CREATED` datetime default NULL, PRIMARY KEY (`ACCOUNT_NO`))Besides the ease of using MySQL i think its a very light fast database compared with other databases on the market. PLUS ITS FREE!


  4. I say better to learn C first. Its not like its a requirement for Java. But its a valuable skill to possess. In my case I learnt C language first then shifted to C++ and right now Im using Java for everything like crazy. But Im glad i have a background in C and C++. Oh and by the way the basics of C, C++ and Java are only slightly similar by the time you get to the object oriented part they are worlds apart. Same logic but worlds apart.


  5. It sounds to me like you need to do some homework on how you want to get this done. There are many many ways to get this done. I would resommend using Java, its the easiest of them all.Using Java you have several options.1. Use JDBC - very very simple especially if you are used to SQL queries and so on.2. Use Persistence Objects - Advanced stuff. For Example EJBs, Hibernate e.t.c


  6. Technically there is no way to get the web session from a normal java class (POJO).However if you wire your POJO into a web application using the J2EE MVCpattern or FrontController pattern.i.e JSP submits to servlet, servlet passes the HttpServletRequest Object to POJO or bean. You can access your web session, your servlet context throught the request obejct.I suggest you do some research on MVC and FrontController design patterns.


  7. This code needs oreilly Image package API

    Can anyone help me to upload to file without using

     

    <form method=post type =encrpted>

     

    <input type=âfileâ name= âuploadfileâ>

     

    if I use <input type=âfileâ name= âuploadfileâ value=âc:\temp\myphoto.jpgâ>

    it doesnât work..

     


    Sendo of course doing this "<input type=âfileâ name= âuploadfileâ value=âc:\temp\myphoto.jpgâ>" will not work. You are attempting to breach the security of your client machine. Imagine the havoc a web developers could wreak on a client machine if he could pick files from the client's machine at will without active participation from the client.

     

    You cannot, i repeat cannot upload a file from a client machine without PERMISSION being given to you by the client.

     

    I would suggest using an applet to copy the file from the client machine since you know the location of what you need the upload. Of course your applet has to be signed and your user has to accept your applet certificate. This way he has given you persmission to read and write files from his machine.

     

    If you do not understand my explanation. let me know i will be more than happy to explain further.


  8. There are lots of books available to help a newbie to Java Server Pages. My favorites include:1. Java Servlet & JSP Cookbook By Bruce W. Perry 2. Servlets and JavaServer Pages (J2EE Technology Web Tier ) - Jayson Falkner and Kevin Jones3. Pure JSP - Java Server Pages: A Code-Intensive Premium Reference by James GoodwillAnd Ill suggest you visit the JavaRanch - http://javaranch.com/. You can always get help from lots of friendly folks who will help when you need it.

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.