Sam Gardner

Ranch Hand
+ Follow
since Oct 02, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sam Gardner

Here is my .jws file; it occurs to me that something might have to be done to get it to work correctly.

16 years ago
Hey everyone-

I am having an issue that is confusing the hell out of me.

I have a fairly simple web service (deployed the easy way via .jws file) that functions perfectly fine when run as a normal java app.

When I have it deployed, I can access it and it seems to run fine, but for some reason my simple test client won't properly pass strings to it.

No matter what string I pass the service as an argument, that argument is always read as "(MEMO)" by the service.

Does anyone have any idea what could be causing this?

I've posted my client code, if anyone wants to see the service code they're welcome to though it seems to be functioning fine with the exception of always reading "(MEMO)" for one of it's arguments.





I really appreciate any help anyone can give me.
16 years ago
Hey Guys-

Can anyone give me any info on building/installing Glassfish V2 on PowerPC?

The target machine is a Power Mac Dual G5, running Tiger (or Ubuntu, or Debian, or Fedora Core anything, or anything else I can shove on here if you think it'll make installing Glassfish easier).

Thanks!
16 years ago
Hey Guys,

I'm trying to send something through a couple of JSP pages that I have, and it's really confusing me.

I have a drop down menu that has the names of different surveys whose data needs to be re-entered for verification purposes. Each one's data is stored in a separate MySQL table, named by a system I came up with. The names are all stored in another table, which also holds Survey_Type variables for each data table. So, a row would contain "NV_SurveyA_PersonA | SurveyA".

What I want the first page to do, is have the options for each survey name be displayed, but the survey type of the name selected to be submitted to the second page (which dynamically creates the entry page based on the survey type).

Does anyone have any suggestions on how to do this? This is the code that I have to display the survey names, and it works fine, but I can't figure out how to add something in to actually set the "survey" attribute to the survey type rather than the actual displayed option.



Thanks,

Sam

P.S. no quips about the appearance of my code, I can read it and I don't give a rat's a** about CAPS.

[ November 29, 2007: Message edited by: Sam Gardner ]
[ November 29, 2007: Message edited by: Bear Bibeault ]
Alright, I'll try to explain what I'm doing with the relevant pages and why I'm doing things this way.

When a user logs into the site I'm creating, they have various options related to data entry into a mySQL server. The option I'm currently trying to implement lets the user enter the personal data for a participant in a survey into the database. The steps I've implemented to do that are as follows (all of the following pages are displayed in an iframe running inside of a main Display.jsp page for the site, to keep everything looking consistent):

1) User gets to a plain old HTML page called Survey.html. Nothing out of the ordinary here; the page just displays a basic form in an iframe. The form's target is the second page SurveyProcess.jsp.

2)SurveyProcess.jsp page doesn't do much other than define a few variables based on what the user entered for the participant's name, DOB, etc. It checks each field against what is expected (ie Dates are in proper form, the participant's ID is in the correct form, etc) and adds an error to the error vector that is created in the bean. If, once it's done processing the data, it doesn't find any errors, the page creates a temporary table in mySQL (named based on ('temp' + "participant's ID") and forwards to VerifySurvey.jsp. If it DOES find errors, it forwards to SurveyRetry.jsp. Both of these forwards are done with pageForward.context("target").

3) VerifySurvey.jsp creates a "display form" (it just displays data, and makes the user click "submit" to get the data into the actual database. Eventually there will be an option to further edit the data, but I need to figure out how to pre-fill forms correctly for that to be useful). The form targets VerifySurveySubmit.jsp, which calls the appropriate methods from SurveyBean to move the temp file into the actual database, and it also deletes the temp file. If the methods succeeded, everything forwards back to
Survey.html. If the ID is already in the database, it says so, and forwards back to Survey.html. If other errors resulted, it outputs them. The error output is mainly "just in case" right now, as SurveyProcess did enough that everything should be in the right form for mySQL to read.

4) SurveyRetry.jsp is basically a clone of Survey.html, but with an added area for errors (Survey.html's form is created in a table; I just added an extra column which holds any errors for each field in the form). Right now, the errors display perfectly (e.g. if there was an error with the ID the error message is displayed in the correct place for the ID) but the original data entered into the field does not. I want the form to display everything the way it was originally entered into Survey.html, so that the user doesn't have to re-enter all of the fields every time they input something wrong. The target of SurveyRetry.jsp is the same as Survey.html, so it keeps getting checked over until everything on it is in the right form.

I'm not very experienced at all with web development on this scale, and I've been going based on the Sun Java documentation and random JSP tutorials I've found online that are kind of doing the same thing I am. Needless to say, what I have so far results in a fairly fragmented understanding of JSP, so while I think my structure is fairly well put-together (at least for my uses; this basic structure is also going to be used for entering in survey data at some point), the implementation of the server requests and session data is not very well defined, and I'm sort of afraid to change what I have going right now without a clear idea of how to make it work in a manner more befitting the modern era (I'm pretty sure some of the tutorials I've been using were written in the late 90's). So, if any of you JSP experts could enlighten me as to how I should be keeping the data first entered into Survey.html persistent (whether to use <jsp:forward> tags or session.setAttribute() statements at some point, or some other technique), I would be very appreciative.

Appendix A) The bean that all of these pages use is called SurveyBean, and has a few methods for mySQL manipulation (so that my site actually generates useful data to stick in the database) as well as stores the current errors and various other miscellaneous "housekeeping" methods.
[ November 09, 2007: Message edited by: Sam Gardner ]
17 years ago
JSP
Well, using the <%= %> tags seems to work better, as the field will now display the results of the session.getAttribute(foo) correctly.

However, it's currently getting 'null' from the session, and I can't figure out why, as the page that sets the relevant session attributes is the process page (and the process page forwards to the FormRetry page if errors are detected). Other pages that are accessed after the process page get the same session attributes fine, so I'm a bit confused.
[ November 08, 2007: Message edited by: Sam Gardner ]
17 years ago
JSP

Originally posted by Bear Bibeault:

Is that really what your code looks like? It's got problems.



Yes, I realize that, hence the topic :P

All I want is for each line of text input to display the previously entered text input.

For example, if the user entered in 192-04-17 for a date field, I want the page displaying errors to display 192-04-17 in the date field, with errors next to it before the user changes the value, if that makes any sense.
17 years ago
JSP
The pages display correctly, if that's what you're getting at. The FormRetry displays the correct errors, it just doesn't display the right data in the Form when you first bring up the page.

My instinct was to try <INPUT TYPE=TEXTVALUE = <%session.getAttribute(foo)%> MAXLENGTH = 4 NAME=3 SIZE=4> but that does not work. It displays "MAXLENGTH" (without the quotes) in each field that I dynamically specify.

Correct me if I'm wrong, but just saying <%session.getAttribute(foo)%> doesn't actually generate any HTML for me.

What I'm trying to get at is
<INPUT TYPE=TEXT VALUE = "VALUE of session.getAttribute(foo)" MAXLENGTH = 4 NAME=3 SIZE=4>
[ November 08, 2007: Message edited by: Sam Gardner ]
17 years ago
JSP
I have an HTML form on my site that is processed by a JSP page. If the process page detects any basic errors, it forwards it onto the FormRetry page. I'd like the data originally entered to be the initial values of the FormRetry page, so the user can see what they originally entered and hopefully figure out what the problem was based on the errors displayed. I've been trying to do it with sessions, but <TYPE = ... VALUE = <%session value%>> doesn't seem to work too well.

Anyone have any suggestions? If this is more of an HTML issue, feel free to send me over to the other forum. I figured it went here because I needed to get something from a previous JSP page.

Thanks!
17 years ago
JSP
As far as my understanding goes, this should be done the same way as in HTML. You put the zip file on your server, and have your hyperlink point to that location, where the browser should recognize it and ask if you want to download it.

JSP is really just code that extends a normal HTML page, anything that's outside the <% %> tags executes like HTML normally would.
[ November 08, 2007: Message edited by: Sam Gardner ]
17 years ago
JSP

Originally posted by Bear Bibeault:

Interesting seeing that sessions have nothig to do with HTML.



Heh, I think I've commented on my lack of experience with anything web-related. I apologize for sounding like an idiot.
17 years ago
JSP
Ah, I see.

I got caught up looking at request parameters and forgot that sessions were a JSP item and not an HTML-specific item.

Thanks!
17 years ago
JSP
Well, page 2 only displays if the data isn't entered correctly, its basically just a standin for when I get an actual error reporting method up and running. I just needed something that would check to make sure that everything is in the correct format so that MySQL can read the query that it's sent.

How would I go about saving everything in the session? That's what I've been trying to do but I can't seem to find a decent guide to it online.

Thanks,

Sam Gardner
17 years ago
JSP
Hey Guys,

I have a bit of a vexing problem.

I have four JSP pages that I need to hold all of the same request parameters, but I can't figure out how to do it so that the third page holds the right data.

The first page is a form.

The second page roughly processes the data in the form (makes sure dates are valid, entries requiring integer inputs are actually integers, etc) and passes the data onto a bean which creates a temporary database file, named via the first request parameter.

The third page displays the data entered into the form, and asks the user to verify that it is what he or she wants to submit.

The fourth page is supposed to call a method from the same bean that page 2 used, and move the data from the temp file into the actual database file, and delete the temp file.

Everything works fine until I attempt to submit the verified data. The fourth page is not getting any of the request parameters (request.getParameter(<name_of_parameter>) returns null).

This is messing up my code because the name of the temp file was dynamically created based on the first request parameter, and the bean method which moves the temp data uses the name of the temp file as a parameter.

If anyone can point me to a good tutorial on using persistent request data through multiple JSP pages, or just explain to me how to do it, I'd really appreciate it.

Thanks,

Sam Gardner
17 years ago
JSP
If anyone was wondering, I figured out how to do this.

Under the console tab in Eclipse Europa (the version I'm using, not sure about earlier editions) there is a button at the top right that's labeled "Display selected console" the second option when the server is running is the server's output log.

It saved me a lot of hassle having to go into the server admin page, hope it helps anyone else who was wondering how to do this.