Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

jeff ukridge

Greenhorn
+ Follow
since Nov 21, 2005
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 jeff ukridge

Hi,

I am in the process of writing a MIDlet for a phone that connects to my servlet.

So far it's going slowly but at least I'm making some progress.

Initially I was going to put in a username/password into my MIDlet but lately I was thinking of going in another direction. (I want my MIDlet to be as small as possible, if I can avoid a seperate LOGIN screen, I would want to)

Let's say that I have four phones that I've installed my MIDlet on. It's OK if one of these four phones connect to my servlet but not any others.

Is it possible for my servlet to identify a phone? For example is there a unique number (like an IP address or GUID or some sort of serial number) that is associated with a phone?

If so, I thought that I could could tell my servlet which phones could connect and have it reject any other attempts to connect.

Is this possible?
16 years ago
Hi,

I'm still just beginning to learn j2me.
I am interested in inputting TIME information.

Right now I can create a field like this:


This accepts the time in a hh:mm:ss AM/PM format.

I'm interested in limiting the input to only hh:mm.

Is that possible?
16 years ago
ok. I think I'm going to go ahead with this. I can't do bluetooth because the mobile units won't be anywhere near the server.

Any recomendation on a mobile device? I was thinking of something like a Sidekick II (T Mobile) or a TREO (Verizon).

Without getting too deep into it, I'm kind of assuming I have a decent set of GUI libraries (like SWING) for building the input app. Also I don't know how the transmit from the device works, would it be anything like a socket connection?
16 years ago
Hi,

I know nothing about J2ME, but I am interested in learning more about it.

Before I get into the web sites and manuals I want to make sure I'm heading in the right direction.

As a starting project I'd like to write a check book balancing application. I'd like to provide input into this application by using a mobile device (mobile phone, smart phone, PDA, pocket PC, etc).

Would I use J2ME to write an application to input the data?

I am thinking that a small application that had a few drop down menus and text fields to collect the input. When I would fill in the data I would want the mobile device to transmit the data back to my server (where all the data would be stored).

Is that a J2ME application?

If so, does anyone recommend any particular mobile device for this?

thanks.
16 years ago
have you tried different paths in your CODEBASE parameter?

For example try using "./" instead of just "."

If that doesn't work, try hardcoding the path during the testing phase. It will help you avoid the burnout and frustration.
16 years ago
Maybe I don't need to use cookies for this (or maybe I do).

On a series of web pages, I have a handful of applets. All these applets share the same code base.

The problem is a basic one. I need to get information from one applet to another.

Let's say I have a LOGIN applet that gets the username from the user (on the index.html page). That applet has an OK button that will load the doWork.html page that has an applet on it called WORK. I want to get the username from the LOGIN applet to the WORK applet.

After reading this:

http://www.javaworld.com/javatips/jw-javatip101_p.html

It seems to me that all I need to do is to have a reference to the LOGIN applet from within the WORK applet and simply invoke the loginApplet.getUserName() method to retrieve the data.

This seems too simple...am I missing soething here?

Here are some code fragments of what I'm planning to implement:

step 1. set up the reference to the LOGIN applet in the LOGIN applet.


Step 2. in the WORK applet, get the LOGIN applet reference.'



Step 3. From within the WORK applet, get the user name data




Is this a sound approach? What if the user tries to access the WORK page before going through the LOGIN (index.html) page first? What happens when the user hits the refresh button or the back button on his browser? What happens if the user is using a tabbed browser and logs in simultaneously as different users on differet tabs (from the same browser)?
16 years ago
Hi,

Can an applet read and write cookies? Most of the examples I see regarding cookies are implemented using JavaScript. I'd rather do it in my applet.

-thanks.
16 years ago
No. I've got the I/O down. I should have proof-read my message before positing it. Clearly I am not trying to read from an output stream writer in my application.

I simply rushed the post and copied the wrong section of code.

My questions remains though.

Can I read output of my server (which would be text composed entirely of HTML code) and use it as input to a URL constructor?
Hi,

I have an applet that connectes to my server. At one point during the execution of the applet I load another web page into the browser using the following code:



This works pretty well. I would like to replace the "test.html" above with the output of my server instead.

Right now I have a variable called "out" that is the output stream of my socket connection to my server.



Instead of referencing test.html, is there any way I can read the contents of "out" instead?

Something like this:



That code doesn't work. I put it here just to help give you an idea of what I'm looking for. Can I read the output of my server and use it as input to a URL constructor?
I'm not sure which forum to post this question to.

Basically I'm looking for "architecture" to develop java applications to be executed with a browser.

For example, I can implement a simple login applet (user name and password) and I can have this applet executed from my index.html page.

But what happens after the user hits the OK button?

In my applet, I would have an actionListener that would display a MainForm.

But this MainForm is "popped up" in a new window. I would want this form to appear in a new browser page just as if the user followed a link on a page.

So...I guess my question would be, how is that accomplished? Would it be through applets, or JSP's or servlets or a combination?

Also, my MainForm would have other buttons and components that may take the user to additional forms, again these would have to appear in the browser just as if the user selected a link.

Does anyone have some ideas to implement this sort of architecture?
16 years ago
Here is an article that may provide you with some points to make during your next software design review or whatever you have at the office.

http://www.javaworld.com/javaworld/jw-12-1999/jw-12-ssj-jspmvc.html

It's a little dated and it may not provide you with anything, but it's worth a look.
16 years ago
ok...2 days later, it seems as if the smoke has cleared.

My problems turned out to be that I had a mistake in my web.xml file.

Also ( I think ) that I needed to use the manager/html application to restart my servlet after I modified the web.xml.


Anyway, clearly my biggest mistake was to not include my complete web.xml to this forum. Somone would have seen a typo there a lot faster than I did.
16 years ago
nothing changing here..I still can't get rid of the 404 error.

Here is the current state of the project.

In TOMCAT_HOME/conf/server.xml:



in TOMCAT_HOME/webapps/WRNR/login.jsp:




in TOMCAT_HOME/webapps/WRNR/WEB-INF/web.xml:



My servlet is in TOMCAT_HOME/webapps/WRNR/WEB-INF/classes/com/WRNR


And the error is:


I've tried many different permutations here. Does anyone see an error anywhere?
16 years ago
I'm new to this so I'm a little confused.

What would my <servlet-mapping> look like?

Like this maybe:



I'm not sure that's right...

how about something like this:




I'm not at my system right now, or I would give these a try. I'll be at my system again in a few hours.
16 years ago
Thanks for the response. Unfortunately it didn't change the error:



Here is my directory structure in my TOMCATHOME/webapps:

in webapps/WRNR:



in the WEB-INF:


And then in classes there are furthere subdirectories:
/com/WRNR

and finially in WRNR is my class:





I was thinking that it could be a permissions problem?

Or maybe I need my web.xml file modified to include a <servlet-mapping> tag?
16 years ago