peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Wow, nice to have input from inside ! ! !
Nice article as always Davey :icon_smile:
I'm happy that Firefox is doing so well as IE is not tool of my choise...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Yeah defenetly difficult to set up with ATI card :(

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

>They could move over to ASP
microworld of microsoft??? you must by joking. For once it is damn slow, for two it crash often then windows and connection to db is awful. I don't know why all computing colleges actualy teach VB and related products

the Month of PHP Bugs can be found here http://www.php-security.org/

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

ever been in army jwenting?

not always best place to be :lol:

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Happy to know that my F-Secure is so good

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Sometimes one line of tool tip is not enough. You may want to try and play around with JToolTip, but if you in hurry this "little hack" can be handy.
With little of HTML plus CSS code you can work out various formats (font, colour, alignment, size etc.).

Kevingon commented: Excellent tip :D +1
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

This is simple example how to get data reading from mobile phone's in-built sensor with JSR-256 and Java Microedition

SensorMidlet.java

/**
 *
 * @author Peter Miklosko
 * @homepage http://www.peterscorner.co.uk
 */

import javax.microedition.midlet.MIDlet;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;


public class SensorMidlet extends MIDlet implements CommandListener
{
    private Canvas mCanvas;
    private Command exitCommand;
    private SensorData sd = new SensorData();
    
    public void startApp() 
    {
        Display display = Display.getDisplay(this);        
        
        if(mCanvas == null)
        {
            mCanvas = new SensorCanvas(sd);
            exitCommand = new Command("Exit", Command.EXIT, 0);
            mCanvas.addCommand(exitCommand);
            mCanvas.setCommandListener(this);
        }
        display.setCurrent(mCanvas);
    }

    public void pauseApp() 
    {
    }

    public void destroyApp(boolean unconditional) 
    {
    }
    
    public void commandAction(Command c, Displayable d)
    {
        if(c == exitCommand)
        {
            sd.closeConnection();
            destroyApp(true);
            notifyDestroyed();
        }
    }
}

SensorCanvas.java

/**
 *
 * @author Peter Miklosko
 * @homepage http://www.peterscorner.co.uk
 */

import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;

public class SensorCanvas extends Canvas
{
    private String mMessage = "Press the key!";
    private int mKeyCode;
    private SensorData sd;
    private int xCor, yCor, zCor;
    
    public SensorCanvas(SensorData sData)
    {
        sd = sData;        
    }
    
    public void paint(Graphics g)
    {
        int w = getWidth();
        int h = getHeight();
        
        g.setColor(0xffffff);
        g.fillRect(0, 0, w, h);
        
        int fh = g.getFont().getHeight();
        int y = h / 2 - fh * 2;       
        
        g.setColor(0x000000);
        g.drawString(mMessage, w / 2, y, Graphics.HCENTER | Graphics.BOTTOM);
        y += fh;
               
        if(mKeyCode != 0)
        {     
            // Get sensor data
            xCor = sd.getX();
            yCor = sd.getY();
            zCor = sd.getZ();
            g.drawString("X coordinate: " + xCor, w / 2, y, Graphics.HCENTER | Graphics.BOTTOM);
            y += fh;
            g.drawString("Y coordinate: " + yCor, …
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You didn't elaborated what you try to achive

Expecting people to use some uknown/custome libraries in the CLASSPATH

You are missing even basic explanation what each sort method is about, what it does

Good code, but you loosing on documentation grounds

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

mail.jar is part of JavaMail 1.4 and you can download mail.jar from here http://java.sun.com/products/javamail/downloads/index.html

activation.jar is part of JavaBeans Activation Framework 1.1 and can be download here http://java.sun.com/products/javabeans/jaf/downloads/index.html#download

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Don't see any point to do something like this with javascript, if you can simple do it in CSS
"text-decoration none".

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

None of the attached packages has folder structure of project. We need to see stuff that is in TOMCAT_DIRECTORY/webapps/YOUR_PROJECT.
For example at this point I have following files in my webapps

so if we discussed "hudson" I would package that folder and attach it. In your scenario it is anything what is listed in your "Project" directory (that is the place where you started to write your code from what I see in your post localhost:8080/Project/WEB-INF/Hello.jsp)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Please package your project in ZIP/RAR and attach to next reply and we will have look at it (you need to be in advanced reply mode to see "Manage Attachments" button so first press "Go Advanced")

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

hi

open:
1 tomcat5.5
2.webapps folder
3.in webapps copy "web inf" and "lib" folder make sure that the lib folder contains all jar files reqrd.(asp.,jsp,servlet)
4. make ur own program folder in webapps itself.
and write ur jsp program with .jsp extensio.

then define the class path thru the my comp advace feature


try............. and enjoy

You just provided badly written answer to something that was answered with link to appropriate well written documentation

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Your titles should be linked with some unique IDs. So then when you select something to delete, you will not use a title that can repeat multiple times, but ID associated with that title

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

General folder-file structure of project under Tomcat is

  • TOMCAT_DIRECTORY
    • webapps
      • PROJECT_NAME
        • *.jsp
        • *.img
        • *.css
        • WEB-INF
          • web.xml
          • classes
            • *.java or copiled *.class
          • lib
            • Any libraries required like ConnectorJ(database connector) etc.

Have look at this materials

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
<servlet>
        <servlet-name>addServlet</servlet-name>
        <servlet-class>servlet.AddServlet</servlet-class>
        
        <servlet-name>loginServlet</servlet-name>
        <servlet-class>servlet.loginServlet</servlet-class>
        
        <servlet-name>registerServlet</servlet-name>
        <servlet-class>servlet.registerServlet</servlet-class>

<!-- ONLY ONE DECLARATION NEED IT -->
        <init-param>
            <param-name>dbURL</param-name>
            <param-value>jdbc:odbc:database</param-value>
        </init-param>
        <init-param>
            <param-name>dbUserName</param-name>
            <param-value>username</param-value>
        </init-param>
        <init-param>
            <param-name>dbPassword</param-name>
            <param-value>password</param-value>
        </init-param>
        <init-param>
            <param-name>JdbcDriver</param-name>
            <param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
        </init-param>
    </servlet>
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

3 threads merge together. Please do not flood forum with same question, simply reply to already existing thread with new updated informations!

kvprajapati commented: Thanks! +13
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Closing down as there is double in C# section. In the future please post only in forum section which is most related to the issue you having.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Please keep in mind that hard-coded location of image is absolute to the emulator. You need to adjust it in regards of your phone. Linked example of device browser will help you get correct path with system call if you deploy them....

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Sorry I just spotted you are using wrong file location. You cannot provide file location as direct access to you pc system. To get this running from emulator you need to place your image into INSTALATION_WTK_DIRECTORY\appdb\DefaultColorPhone(or what ever phone you choose to use)\filesystem. Here you should find 3 drives c:/, e:/ and root:/ (or c%3A, e%3A and root1)and place image in one of them (c:/ is recommended as that stands for device memory also this image placement can be little try-and-error as I'm using Sony Ericsson WTK where image location is as C:\SonyEricsson\JavaME_SDK_CLDC\WTK2\appdb\SonyEricsson_W810_Emu\filesystem\c%3A\pictures\camera_semc\hdd.png and in application I used fconn = (FileConnection) Connector.open("file:///c:/pictures/camera_semc/hdd.png"); ). Bellow code is working fine on my pc with Sony Ericsson emulator emulator.pngimport javax.microedition.midlet.MIDlet; import javax.microedition.lcdui.Display; public class LocalImage extends MIDlet{ private Display display; public LocalImage(){} public void startApp(){ if(display == null){ display = Display.getDisplay(this); } display.setCurrent(new MyForm()); } public void pauseApp(){} public void destroyApp(boolean unconditionl){ } }

import java.io.*;
import javax.microedition.io.*;
import javax.microedition.io.file.IllegalModeException;
import javax.microedition.lcdui.*;
import javax.microedition.io.file.FileConnection;

public class MyForm extends Form {

    private Image image;

    public MyForm() {
        super("Display Image");

        FileConnection fconn;
        TextField textAfter = null;
        try {
            fconn = (FileConnection) Connector.open("file:///c:/pictures/camera_semc/hdd.png");///Data/Images/200908/200908A0/25082009004.jpg");


            InputStream in = fconn.openInputStream();
            image = Image.createImage(in);
            in.close();
            fconn.close();
        }
        catch (IOException e1) {
            textAfter = new TextField("e1: " + e1.getMessage(), "", 30, TextField.ANY);
        }
        catch (IllegalModeException e2) {
            textAfter = new TextField("e2: " + e2.getMessage(), "", 30, TextField.ANY);
        }
        catch (java.lang.SecurityException e3) {
            textAfter = new TextField("e3: " + e3.getMessage(), "", 30, TextField.ANY);
        }                 

        if (image != null) { …
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

openInputStream can beside IOException throw also IllegalModeException and java.lang.SecurityException you need to catch them too.

Few suggestions on top of this, you should also close InputStream, move form(append) out of try-catch inside simple if/else statement to check if image is not null and based on outcome of this boolean operation you will either add image to form or do nothing

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Dunno why you did not install latest Tomcat 6, but hey...

What we need to know is what OS you using and what installation steps you took to install Tomcat on your pc.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@puneetkay LOL seems you are offended even though the above line came from movie :D, sorry for misunderstanding. Nevertheless if you try to help make sure you do not pick up first resource that pop up on google, which in these cases unfortunately is that terrible site.

@Pmarcoen as you can see the example that you found show only way to access folders (first comment to article) and few replies down the line it does show how you can get document. General idea is:

  • Check if FileConnection API is present on device (there is still number of device they do not include this library)
  • Provide file location/URL (this step can be replaced by example from my link where you browse local storage to find desired document)
  • Check if file or location exists (if location is hard coded)
  • Check for access permission (dependent on what ever you want to do with document)
  • Use either of the stream methods to read the document ( openDataInputStream() or openInputStream() )
  • and in your case use one of the createImage() methods create image
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Reading minds and magic balls is out of date. Provide relevant code...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@puneetkay in traditional street proverb "I gona nail your a$$"linked website is worst case scenario of any tutorials
there is support for loading images from device in-build memory and memory card

All you need to do is use JSR 75 - PDA Optional Packages for the J2ME™ Platform with File Connection API and you there. Here is simple example of device browser that can be used either to extend functionality in order to find and use selected file or simple reuse the principles used in this case (provide path, check file existence and use the file)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Google is your friend - Background Image On J Panel

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Head first servlets & JSP is good book, here is limited preview from google books. Also have look on javapassion.com(however materials are based on GlassFish server compare to most examples on Tomcat)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Very simple create instance and initialize the class that will be your data holder, then trough instance access any available methods and retrieve data as need it. Bellow example should be sufficient

public class Person{
	
	private String firstName, lastName;
	
	public Person(String _firstName, String _lastName){
		setFirstName(_firstName);
		setLastName(_lastName);
	}
	
	private void setFirstName(String _firstName){
		firstName = _firstName;
	}
	
	public String getFirstName(){
		return firstName;
	}
	
	private void setLastName(String _lastName){
		lastName = _lastName;
	}
	
	public String getLastName(){
		return lastName;
	}
}
public class PersonTest{
	
	public static void main(String[] args){
		Person person = new Person("peter","somebody");
		System.out.println("First name : "+ person.getFirstName() 
			+ "\nLast name : " + person.getLastName());
	}
}
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Placed request to move this post.

Java != JavaScript

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Install downloaded package and do not forget to set PATH as explained here

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I'm sorry dude but day has only 24 hours and there are only 7 days in week. Out of this time I spend most at work, plus there is some personal study and quality time with girlfriend and only after this comes sleep and daniweb.

Secondly reading someone else code is time consuming specially if code is not well organized and there is no chance of face to face interaction.

To start I give you task to perform. Your GUI handling (moving from screen to screen view) is very bad and is building on each other. To accomplish simple move from one screen to another only thing you need to pass is instance of Display screen, which I seeing in your code is done badly, example:

public void startApp() {
    Display.getDisplay(this).setCurrent(new ListTypeSelectionScreen(this));
}

ListTypeSelectionScreen(this) is effectively passing instance of whole MIDlet and its get even more messy with classes to follow after it.

Displayable screen = new ListSelectionScreen(midlet,ListTypeSelectionScreen.this, listType);

Here beside forwarding MIDlet instance you even forward of current screen. What for????

Check this code, above issue can be done with simple passing instance of Display

import javax.microedition.midlet.MIDlet;
import javax.microedition.lcdui.Display;

public class GetDisplay extends MIDlet{

    private Display dis;

    public GetDisplay(){

    }

    public void startApp(){
        if(dis == null){
            dis = Display.getDisplay(this);
        }
        dis.setCurrent(new NextScreen(dis));
    }

    public void pauseApp(){}

    public void destroyApp(boolean unconditional){}
}
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.StringItem;
import javax.microedition.lcdui.TextField;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Displayable;

public class NextScreen extends Form implements CommandListener{

    private Display dis;
    private …
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Can you please edit your post and add code tags??

[code=java]YOUR CODE HERE [/code]

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

OK, post moved to Java section.

Would you mind to post relevant code to we can see what is going on in the application?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Have look at sourceforge.net at pick up any idea you like

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I got my B.tech(computer science)with first class.
i have good knowledge in oracle 9i,sql,pl/sql basics.
i am searching for a job.i dont have experience.
Please any one help me to have good job to start my career.

Another to adds to millions waiting for their dream job landing in their lap without any work.
If you having difficulties get a job because you are reject based on zero experiences, why don't you look for some unpaid charity work where you can prove you are good with databases and use this experience to enhance your CV? If you have more questions in regards of this make new thread in IT Professionals' Lounge

Closing down thread, no need for revision in next 2-3 years by another lost soul...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Post your up-to-date code and I will have look at it latter when I get home from work

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@sivak please stop creating multiple posts with same question in numerous forum sections. If you advised to ask the question in other forum either ask for thread to be moved to appropriate section (by clicking on Flag Bad Post and type something like "Please move this to Ajax section") or mark present discussion as solved and only after that create new thread in different section.

And for god sake start reading forum rules! Never seen anyone with 13 infractions for long time, just because person was so ignorant...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Without coding it is difficult advice...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Did you downloaded Connector/J and pointed your IDE or set a CLASSPATH to location of this JAR file?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
  1. Very badly written project requirements
  2. This forum has following rule We only give homework help to those who show effort
  3. You seriously think that we will do it for you specially when you write "I do not have time, I want to have it in 2 days"? Bad time management curries penalty of unfinished or started projects, so deal with it!
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I'm at work at the moment and cannot provide full answer, by your problem is in data consistency handling. Class A collect list index selected pass next class that try to locate PIM detail related to this number and then again you passing selection number. Be consistent either pass along unique ID of PIM contact or pass along PIM object which hold selected contact

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Start using servlets...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Sorry I do no see logic in what you trying to do. Redirect is for giving up current document and moving on next one and not holding on old location.

Will you explain what you are up to?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

can u give me the site for downloading latest full-version softwares, latest movies, latest songs(hollywood) & many other stuffs.

You are in wrong place kid. We do not provide any illegal downloads and anyone even attempting to do so is kicked! Consider that for the future...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I have a question, what if I was trying to work with more than one table?

It makes no difference to us...

Now, are you gone answer previous question about code you using?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Can you check the uploaded code because there is error on compile from ListSelectionSelected line 173

screen = new ItemDisplayScreen(this.midlet, this, this.listType, this.list, asa, j);

Class ItemDisplayScreen has only this constructor

public ItemDisplayScreen(BUPBClient midlet, ItemSelectionScreen caller, int listType, PIMList list, int asa, int asi)
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Not relevant to Java Server Pages, moving to JavaScript