This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!

Glen Iris

Ranch Hand
+ Follow
since Jul 13, 2011
Glen likes ...
Chrome Java Netbeans IDE
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
3
Received in last 30 days
0
Total given
65
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Glen Iris

Hi Guys,

I passed the OCJP 6 exam back in 2012. I was hoping to upgrade my certification to 9.

1. Are there any books that you can recommend for this?
2. If not, what is the best book to go from 6 to 8?

Thanks,
g

L Foster wrote:Hi, Glen.
given you annotated IrisService as @Service, have you injected it using @Autowire?



Yes 

L Foster wrote:
However, did you do any research on whether this might be some kind of order dependency?


no. It seems to me that I cannot autowire a dependency into class that is itself, autowired into somewhere else. Makes no sense and I am sure I am doing something ridiculous. As a work around, I have just instantiated the dependencies using old fashioned Java. Object x = new Object();

L Foster wrote:
Finally, I have not looked at "@Service" yet.  Still learning.  I have seen @Component, and that is treated as a bean.



This may be the blind leading the blind here but AFAIK, @Service is just a more specialised version of @Component.
1 year ago
Hi Guys,

I have been working with Spring for a while now. I have felt my way around rather than learned via certification. One thing that I have not figured out yet is this scenario.

I have an endpoint 'GlenEndpoint' annotated with @Endpoint.

'GlenEndpoint' has an Autowired service 'IrisService'. IrisService is itself annotated with @Service.

This works well as long IrisService instantiates any dependencies as POJO's in the old fashioned way. Eg,



However, if I attempt to autowire the AmountOwedUtil object, the application can not start up correctly, complaining that there is no qualifying bean of this type. This happens even though I have annotated the AmountOwedUtil class with @Service. I have also made sure that all relevant packages are covered by component scanning. I should mention that AmountOwedUtil is in a separate package to both IrisService and GlenEndpoint.

I know that this is likely something very simple, but so far it has me banging my head against the wall 

Please help,

G
1 year ago
Hello again guys.

I have spent the past week implementing PRG and mine eyes have been opened. It is exactly what I needed.

However, I am still seeing one issue. My application uses Spring Security. I have a method to handle GET requests to '/login' (the login page) and this is fine. Any POST requests to '/login' are obviously handled by Spring as I did create a method to capture POST requests to '/login' but my break points were never hit. Therefore I cannot explicitly enforce the PRG 'Design Pattern' here as Spring is handling POST calls to the 'login' url.

The issue I am seeing is, when a user logs out, they are redirected to /login. If the user then refreshes the 'login' page, and subsequently attempts to enter his/her details, they see a 404. I had suspicious around what was causing this but so far, my investigations have not proved fruitful. Below is my Spring Security config:


I would appreciate any clues toward what you think the issue may be.

Many Thanks,

g
2 years ago
Perfect answer. Sincere Thanks Bear. I knew there was a way but had no idea what it was.
2 years ago
Hi Folks,

I was hoping for some advice. I am building a java spring web application. A feature exists in the application whereby a user can create a booking. Once they do so, they are brought to the booking confirmation page. My question is, how should a web app behave when the user clicks 'back' at this point?

So currently, they just see a browser (Chrome) warning . I am wondering, how should I handle this? Should I intercept the back call and bring them to a 403 (or some such generic) page? Should I disable the user from clicking 'back' in the browser. I know that neither of these options are good ideas, but I am not sure what other options I have. I would love to hear how you guys handle similar situations.

Thanks again,

G
2 years ago

Tapas Chand wrote:In web.xml you have defined the session cookie http-only.
But you have not made it secure.
Have you yet learnt about the <secure> attribute?



Thanks for the reply Tapas.

I have been searching for more information on '<secure>' but have not found any. Can you help me narrow my search please? Is it a Spring specific thing?
3 years ago


You could have a request Param in your method signature for all 3 ip strings. Set the required to false. Then add logic in the method to determine which parameter, if any, has a value.
3 years ago
Hi,

You are attempting to send your from to /signin.

You need to have a method in your controller that will map to that. eg:

3 years ago
Hi Guys,

I have configured my Spring application using xml (things were going that way...)

Using Chrome, I can see that my session cookie is not checked as secure. I already have the following code in my deployment descriptor (web.xml) file:





I was wondering if there is any Spring specific task I need to perform in order to achieve this?

Thanks,

G
3 years ago
Hey Friends,

I want to learn Spring and having played around with it for some time now, I still have not got the hang of it.

I am toying with the idea of shelling out for Spring training. I was wondering:

1. How good are the courses, i.e will I have a great understanding of Spring afterwards like I did of Java when I completed my Java Certification?
2. As a Spring novice, could I do the Spring Web training instead of the Spring Core training (the web topics look like they could be useful on a forthcoming project)

Thanks,

G
Hey folks,

I have configured a SOAP web service using Spring and xsd's. It is fairly simple, My service hits a class with hard coded values which get returned to the caller of the SOAP service.

I would now like to have that hard coded class read from a database. But I would like this to be configured with Hibernate. So I know I need to annotate the class, its properties and its methods with Hibernate specific tags like @column. However, when I do this (type the annotations in the class file) and compile the application, these annotations get overwritten as the Class is being generated by an xsd.

My question:

How do I adapt my xsd to also include Hibernate annotations?

Joel Mata wrote:

Hi Glen, not much to add, just an confirmation that i did receive the same answer from Oracle. I did the Java SE7 fundamentals, it seamed to be the cheapest option.



Hey Joel,

Did you get much / learn much from the course?