This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!

Howard Watson

Ranch Hand
+ Follow
since Jan 07, 2004
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
8
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 Howard Watson

And I should have deleted this out of that JSP:

I thought I outlined my question and no it is not a homework assignment. I've used XHTML for a long time. It enforces good syntax. You leave off a '/' and it won't work. Just a personal preference. XHTML5 is still part of W3C.

Anyhow, in that simple JSP if text is input to the empty textbox and text is edited in the textbox with Xs in IE11 it prints exactly like it was before the text was edited. An empty textbox and one with Xs.  So I was looking for a second opinion that maybe I declared it incorrectly or was missing something else.
Curious if anyone sees something broke here.

Copy to a JSP. Serve from an application server and type something in the text boxes in IE11 and Print preview. Works fine in Firefox and Chrome.

Thought it was worth mentioning that as of Tomcat 8.5.3 the server attribute is not set by default on a connector and apparently Netbeans uses it.

https://bz.apache.org/bugzilla/show_bug.cgi?id=58750

2 years ago
Drop that FK from the Users table and regenerate the entity in Netbeans and I get

like it should be
instead of

Wish I'd caught that (understood) on day one. That was the first table I generated and coded against in this refactor. Now I get to edit all the entities that have valid FKs into the Users table and code and...

Thanks for listening.

Have a great weekend.
I'm guessing this is my issue:

as I found a FK in the Users table to its own UserId

Love refactoring
I have a User entity generated in Netbeans from an existing database table. The table has a column lastUpdatedByUser that is a User entity. Most of the tables in this database have a lastUpdatedByUser column and queries against those entities correctly return a user object as part of the result.

Ex. Retrieve FROM ProductionTable WHERE date = 'someDate' has a lastUpdatedByUser object that shows who last updated the table row and the rest of their user attributes.

If the productionTable data is edited in the web-app and submitted I need to update the lastUpdatedByUser column.

returns a User object that contains a lastUpdatedByUser that is a User object that contains a lastUpdatedByUser that is a User object that contains a lastUpdatedByUser object.... (I have no clue how many there are, and twenty rows of these adds up)

After I persist this

I get Json StackOverflowError in the next request for the updated entity

The Users entity definition:

How can I edit that such that I continue to get a user object as part of other entities like Production, but only a single lastUpdatedByUser object for a User entity?

Thanks for any insight.
This got me past null and a new error:



Thank you.
Guess I knew the first part of that. Does that mean I cannot use Frontman or that I need to use it differently? Thanks for the reply Bear.
Simple servlet that works:



Simple Frontman command that EntityManagerFactory is null:



The code is almost identical. I read elsewhere that what's in brackets

{@PersistenceUnit(unitName = "JPAtestPU")
private EntityManagerFactory emf;}

only works in a client class whose lifecycle is managed by the container, i.e. an EJB, a JSF ManagedBean, a CDI bean or a servlet.

I'm rewriting an existing core JDBC Tomcat web-app. I had started out to just update it to try-with-resources and a connection pool. But, I've decided to try OpenJPA instead. How do I make this work in Frontman 2? Are commands not being recognized as servlets?

Thanks.
A syntax error here: <c:forEach items="$(lecturerFullname)" var="i">
2 years ago
JSP

Bear Bibeault wrote:WAG: are the missing objects Serializable?


Yes sir, they are now.

William Brogden wrote:I would bet that those references are lost because those classes are not serializable.
Servlet containers are allowed to serialize sessions to disk whenever they want.


Thanks Bill.

http://tomcat.apache.org/tomcat-7.0-doc/config/manager.html#Persistence_Across_Restarts -- the <distributable> element is a huge boon.

Howard Watson wrote:I never know when it's going to happen so I can't trace it.


In the Conversational State section of HFSJ there's a discussion of HttpSessionAttributeListener that I am never supposed to need because "all my attributes are straightforward Serializable objects."


Thanks y'all!
4 years ago
I'll take responsibility Bill. I looked at that after Bear mentioned it. Most results refer to a clustered environment. If I am missing something here in servlet design and you want to throw some hints at me, I won't duck. Some references suggest serializing the session because it's scalable.

And just curious, should I be able to reply to this from mobile. I saw new topic but not reply.
4 years ago
I'm seeing this on my local machine, NetBeans7/Tomcat7. The user's menu object is constructed at login based on application permissions/roles, then saved to user's session and added to the JSP as an include file .jspf.
The jspf has <c:forEach items="${sessionScope.menu.submenus}" var="submenu" >.

The MenuBuilder class reads the users permissions previously stored on the session constructs the menu object and returns the object to PopulateNewSession class where it is stored on the session. PopulateNewSession is called within AuthenticateUserTask class.

4 years ago
I don't know the answer to that, so I'll have to figure it out. I would not have expected to need them serialized, but that's as good a WAG as any.
4 years ago