Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Charessa Reilly

Ranch Hand
+ Follow
since May 26, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
4
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Charessa Reilly

Yeah, there are times when I just feel like I'm in the wrong position.

I'm used to working in PHP and Perl - I would get errors right in my face as soon as I ran them. I'm used to seeing it in one place.

So when the console shows SOME things -- the stuff I wrote into my bean to display -- but doesn't show me a stack trace, i forget I have these handy logs.

SOooo yeah. I was still using an old version of a bean. Which was causing the failure. Time from checking log to successfully testing the fix: 2 minutes.

>.< Sorry to bug everyone with my ineptness.
6 years ago
JSP
What would make a JSP not finish running and not throw an error?

I have a JSP that queries an MS Access database, which is a very slow process (we're hopefully going to be using an Oracle database soon). But this code I've been using has always finished executing before.In addition, the page is displaying information that is in the page well after the connection the database is closed.

After it takes the information from the database it puts that information in some beans that I've written for this app. The beans have been working normally in a nearly identical set of code in a different JSP.

It then iterates through the list made of the data (a list of 35 items, which is the count it gives me when I have it display the size of the results) and displays data from up to 10 rows that meet certain criteria. It does fine through 15 iterations then stops without any error (showing 5 of the 23 records that meet the criteria). Then it just stops. No error, nothing else. It just shows me the output line at the end of the loop then stops.

Is there a timeout setting in Tomcat that I can extend? And if there is, does the timeout record an error?
6 years ago
JSP
OOOOOOOOOOOOOR

it could be I'm stupid. Just noticed I'm missing some $ there.
6 years ago
JSP
I think I'm operating under some sort of misunderstanding of "if" or maybe JSP and even Java in general. I have this code:



When it executes I get a popup alert that says "simone mitchell" (the value previously put into irecord.manager) then a popup that says "up yours" (you can tell I'm getting frustrated at this)

Shouldn't I get a popup in between the two? How can both those "if" statments fail?
6 years ago
JSP
I... hadn't realized I could use c:set. I thought it was just for jsp variables, not bean interaction.

but after a little research, I tried that and it worked

Thanks!

(no, there weren't any other beans with that name)
6 years ago
JSP
(it's almost been a week! Did you miss me?)

so my jsp uses this code:


the setter in the InquireRecord class:


the output:

the value is:



I'm not getting any errors anywhere. it's just not setting that property. Any ideas? (in other words, what typo and major misconception do I have this time?)
6 years ago
JSP
yeah, the "a" was just an indefinite article. I swapped the name out. And, actually, this helps with an issue in another issue in another area. So I'm glad I asked. Thanks for the help!
6 years ago
JSP
even though if I'm not using a bean?

ugh. hwo about I just make them all lower case. Will later maintainers hate me?
6 years ago
JSP
maybe I'm missing a fundamental principle of custom tags.

I thought <%@ attribute name="someName" required="true" %> was all the code I needed to write in a tag to create that attribute in the tag. The jsp container would then create the appropriate getter and setter for it when it compiled. Am I wrong? Do I need to go back to jsp kindergarten?
6 years ago
JSP
for kicks, I even tried switching the order of the declarations: and the error message remains the same.
6 years ago
JSP
I tried calling it with this:

<inq:singleRec aUser="${user}" theID="${id}" />

and I got the same result. ${user} is a properly assigned field. If I take out the tag call and put in just ${user} it displays the variable's value.
6 years ago
JSP
Just doing what I've learned. See the first line of my above post. Still very much learning.
6 years ago
JSP
It's time for another round of "Charessa has no idea what she's doing!"

Ok, so I'm calling this custom tag:



With this code in the .jsp file:


and Tomcat is telling me:

/detailview.jsp(32,4) Unable to find setter method for attribute: aUser



(line 32 of detailview.jsp corresponds with ]<inq:singleRec>)

soooo.. what did I miss this time?

edit: fixed the line the error was referring too, I copied the wrong line at first)
6 years ago
JSP
Sigh. I have so much to learn.

Thank you very much, that did it.
6 years ago
JSP
Yay! Another post from me!

I've got an if statement in a bean that seems to be processing fine when I create a test java class, but doesn't work fine when the bean is invoked by a jsp.

My code, let me shows you it:

First, the test class:


a snippit from the IrCollection class it calls:



There's more code in another method that calls this particular method using:

But the problem is that if (datum=="none") portion in the second code sample. Given that line 10 of the first class sets the member variable sort to "none", that processSort() method should set the member variable fullSort to " ORDER BY lastUpdated DESC"

And if I use the class in the first sample, it does that.

HOWEVER

I have this custom tag:


Which the .jsp file invokes with this:


In other words, the exact same data is fed to the IrCollection bean. so I should get the same data, right?

Except I get this:

WHERE cotr = 'none' ORDER BY non DESC



so when Java calls it, it thinks "none" == "none"
but when jsp calls it, it thinks "none" != "none"
6 years ago
JSP