peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I hope this piece of doPost() method will be part of the servlet and you not planning to stick it into JSP.
If you want access something from Java in the JSP view you need to import appropriate library in something like this

<%@ page import="java.util.ArrayList"%>
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Why revive a 2 year old thread?

To spam some ruddy website

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Java Sun website Custom Networking tutorial should help you

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
import java.awt.Dimension;
import java.awt.Toolkit;

public class ScreenResolution {
	
	public static void main(String[] args) 
	{
        Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
        System.out.println("Dimention is "+(int)dim.getWidth()+"x"+(int)dim.getHeight());
    }
}
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Oh silly, I sure do need break, but hell have to finish project first.

The bellow code illustrate what is your problem. String b is assign two double quotes and that is exactly what you receive if user does not provide username or password

public class StringTest 
{
    public static void main(String[] args) 
    {
        String a = "peter";
        String b = "";
        if(a.equals("peter"))
        {
        	System.out.println("a is peter");
        }
        if(b != null)
        {
        	System.out.println("b is not null");
        	System.out.println("however b length is "+b.length());
        }
    }
}

Return will be

a is peter
b is not null
however b length is 0

Therefore I would recommend to use length() method to see if there is something. Beside that when comparing string you should not use direct "==" or "!=" but use methods related to string like String.equlas(Object), String.equalsIgnoreCase(String) or String.compareTo(String).

Here is small tip on Strings.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Your validation will always return true because of red marked. I think you wanted to say false

public boolean isValid(){
   valid=false;           //let by default
   if((username != null)&&(password != null)) {
	valid=true;			
   }
	return valid;
}

As for the second question you can pull Bean to use any time you need. Question is, would it hold any data... (in the meaning did you initialize the bean with some values or it will just return NULL)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Please search forum for "hacked website" or similar terms. This was already discussed previously. (Sorry can provide exact links, little busy for searching forum)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Hi! I have to merge two pdf file in to one pdf file using TallPDF.Net 3.0 any one can guide me on this issue. Please reply anybody as early as possible.
Thnks

Hello there!
Here is your 24/7 service on special demand...
No this is not how it works on this forum. We help if you show interest, however your question is of general type. Therefore have look on TallComponents website for some examples of TallPDF.NET 3.0 and they also have Developer Guide.

PS: There are other libraries to work with PDF and conversion to PDF format like iText which I like, but I'm Java programmer ;)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I though that all what need to be said was said in this thread. Is there any specific reason to get over it again?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Your explanations doesn't make any sense...
First you ask

I want to retrieve data from database in jsp page based on the particular m_emp_no .

and I gave you the answer. My query will not return only one value. Will return all listing where employee number occurred. So if there are multiple entries for pl, sl and cl they will be all listed there.
Either provider clearer explanation or give example of table and example of expected output.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Query to find these data on employee number 1004 would look like this in plain SQL

select m_leavetype, m_bal from TABLENAME where m_emp_no='1004';

Now you only have to cast it in your connection and replace 1004 with ID retrieved from user input.
Is that what you want?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Have look at this tutorial. It is not finished yet, however you can use it for initial start

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Please post your code

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

This seems to be handy tutorial, plus more from google search

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

This is random issue, I think it has to do with data processing by browser. It does happen to me too. I will then just click on Coffee House instead of searching for other options and there they are, all option available to my user level.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

This is common problem with Firefox when connection delayed and read page styling was no applied. Looks like they still did not sort the memory leak from previous versions. I often see large CPU and memory usage by FF for no reason, then I usually shut down the browser.
If this happens in future refresh the page and clear browser cache, in many cases this solve the issue.

PS: If you have second pc try to check also there

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Shame, self promotion javaAddict ;)

Lets have one on me http://www.daniweb.com/forums/thread141776.html

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

This link might help get you started: http://www.lac.inpe.br/~rafael.santos/JIPCookbook/6050-howto-compareimages.jsp

Look like Rafael made some changes to his site since last year. I was working with his examples when I did my university final year project on TIFF to PDF conversion and vice versa.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I'm locking this post down as it become spamming place for some parties to advertise their sites and it may get to attention of others!

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Here is tutorial on Flash in HTML. I do not think special effects will influence the video quality, but more likely the size of the final video - it will be bigger.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Spot on, I just merged these two

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You should use JavaScript for this

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

This post is FIVE years old ! ! !

PS: The hidden advertisement of yours is not welcomed.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Welcome...

I believe this thread will help you :)

daniweb.com/forums/showthread.php?t=25517

Good luck :)

It is good link Dude, but unfortunately it will not help somebody who is running Mac OS or Unix. I asked about OS as original poster name suggested he maybe Mac user

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Well, judging by the post before this one, yep.

jwenting wrote it last year :D

and no to silviya,we are not 24/7 service for students with no intention to learn. Write the code and if you have errors you welcome to post them and sk for help.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Type of operation system would help and also exact error messages. Then this post will be moved to appropriate forum section

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Isn't this Coldfusion question?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

When you want to store something or retrieve stored data

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

google.com ==>> java+demo+project

Laziness, the worst illness of humankind.

stephen84s commented: Ha Ha Ha ... Good one !!! +2
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Awn, I think he may already sorted or give up on this problem. Post is 3 year OLD!!!!!!!!

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Please post your coding, reading from magic ball is special skill non of us have ;)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

These two parameter define if you are getting circle or oval/ellipse shape. So if the width and height are equal you drawing circle, if they are of different size you get oval. More on topic can be found at Sun tutorial: Working with Geometry

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

>They manage to ignore all the other hints we throw at them, what makes you think they'd read this one?

Force them to read it :)
Make it appear for 20 seconds on the screen with no way to escape.

That will not help as you will loose members by forcing it that way

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Right click on project folder -> Properties -> in Category select Application Descriptor -> on right side of the window click on the MIDlets. Here you need to point NetBeans to MIDlet in your project. Click Add and find location of BlueChewMIDlet.java. Compile and run

Alex Edwards commented: The Phone Guru +3
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Dunno what could cause such thing. OK, in attachments are source files as I have them. They working fine. Just place these files in the project "src" folder to replace what ever you have there and run them. Let me know if you getting any errors etc.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

OK this getting interesting as I had to correct WTK and remove resource. What you get when you right click on project folder and select Resolve Reference Problems (second option from bottom if there any reference problems)?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Do right click on project folder kb-ch20 select Properties from the bottom of the menu. In Properties check platform settings select in Category -> Platform and check if it is pointing to your WTK or is requesting something from outside (correct it if wrong).
Close this dialogue window. Expand project folder view kb-ch20 -> Project Configurations -> Default Configuration -> Resources and delete the pointer to non-existing resource location on D:\ drive (looks like Jonathan had something there and forgot to remove it)

Let me know what it does now...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Red underlining means either there is an error or you missing libraries. In your case it is the second option as the program is OK. Do you have Mobility pack installed on your NetBeans?

As for application

  • BlueChewMIDlet provides user interface and coordinate the remaining objects of the application.
  • BlueChewFinder provides device discovery, the list of found devices is stored in Vector
  • BlueChewServer is the service itself.
  • BlueChewService - compact represenatation of ServiceRecord, it holds name, address and connection string
  • Log - keeps track of a list of messages (Jonathan used it for debugging)
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

If you just trying show-casing on different pc make sure that it has installed Java, Tomcat server, MySQL server and that you transferred your little database to the MySQL server

PS: Lol beaten by ~s.o.s~ for speed of posting

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You need to sort the basic. This is supposed to be application for mobile devices. Therefore we do not use main() method but go with MIDlet and its three subclasses startApp(), pauseApp() and destroyApp(). Have look on this example of BT communication from Jonathan Knudsen (download chap 20)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Can you post your code? It will make debugging easier...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Option one

String url = request.getRequestURL().toString();
System.out.println("Request from = " + url);

Will return something like this
Request from = http://localhost:8080/daniwebtutorial/login.jsp

Option two
Use the session to pass user group details along the process. In the validation servlet you will retrieve the session, check for user group and redirect base on that

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

The simplest version of calendar can be based on example provided with Tomcat installation JSP Examples->JSP 1.2 Examples->Calendar. Downfall is that you work across multiple pages from
-current month with year you can either

  • select next/previous month view
  • select a day of the month
    • you can go next/previous day
    • select time
      • set appointment on given time

However if you looking for something more compact you looking either to use custom tags or JavaScript

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

LOL, this is mess. From leave I understood that you want to create logout process that is why I said to destroy sessions. If it is not case of logout process simply direct both pages to servlet that will process request, update sessions values and depending on user group direct to relevant page you need it to go. The flow can be like

login->login servlet->main page for user(user will pick form submission)->form page->validation servlet(validate form, update session, redirect)->main page for user

Is that what you trying to achieve?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

After pressing leave you want to direct them to small servlet that will destroy previously created session and then forward them to final page. Therefore your pages after successful login should check for validity of session.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I had second thought in regards of current problem. The query currently satisfies the need of checking user group assignment however it does not check if the user is authenticated. Meaning we did not check if user name and password are correct. Therefore you either have to run first query first query that will check login details and then second query as discussed above, or just have one query as

select emp_approver from TABLE_NAME where emp_id=LOGIN_EMP_ID and password=LOGIN_PASSWORD

This will return a value if login details are correct and you can use this value in your servlet to determinate which view to display. It was my mistake to concentrating on "does the user belong to this or that group".

As for the question about posting. If current problem solved, you should create new thread. (Also would be nice if you mark this post as solved, to let know others that you got your solution)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

LOGIN_EMP_ID is the emp_id on login submitted on login process, which you retrive from the login page compare with database for authentication and see what that person in the system in order to provided with appropriate user view

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

OK, here is query I come up with.

SELECT if(count(emp_id)=TRUE,'true','false') FROM TABLE_NAME where emp_approver="approver" and uid=LOGIN_EMP_ID;

the result of the query is BOOLEAN true or false
Simpler version would be

SELECT count(emp_id) FROM TABLE_NAME where emp_approver="approver" and uid=LOGIN_EMP_ID;

the output is numeric value zero or one, if you get value larger then one something wrong with your table as I expect emp_id to unique.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
  1. Would be nice if you started to take care how you write, decrypting your last message took me long
  2. What version/type of NetBeans you using if you do not have Apache already with it?
  3. If you choose to use stand alone installation of Tomcat then it has to be the zip version (or tar in *nix case) as Windows installer doesn't provide bat files in Tomcat/bin folder need it by NetBeans in order to use it
  4. If you get errors from your project or IDE please provide full reading of them, not just partial what you remember