Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Spring MVC, including jsp's in jsp's

 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Fairly new to spring, have done some .net web development.
I find it hard to find the info I need/want on Spring, so I am asking this question here.

(I will use the idea of a book shop as an example)

I want to have a list of Authors on the left hand side of my page, and when you click on one it will display the authors details.

a)how do I get it so the list of authers stays put, ie is always on the left hand side. Can I write a jsp file that just has the mark up (no head body tags) for the author list? (I will experiment if this but thoughth i would ask anyway)
b)When displaying the Authors details, I want to hide some details, current publisher for example, until a link (publisher) is clicked on then that area "opens" to display the details.
You see this functionality on the web quite a bit.
I am having an issue in my head, because teh form will post back to itself, but will have two backing objects, author and publisher, or will have to use a different query to populate the auther object with a publisher. (I am NOT currently using ORM so no lazy fetch is avialble, I am begining to think that I should ORM this before continuing).

Now I am NOT wishing to do this as a web2.0 (ick) app, so I know that clicking the link with cause a refresh etc, and I am happy with that right now I have no intrest in web2.0 its really more like web4.0 or 5 but there you go.

Sorry i dont know what these UI metaphors are called, but (b) would be akin to the details button you get in windows pop windows for setting options.

I guess back in the day I would have used frames to do (a) (web3.0 days perhaps? ) (a) really is like the class/package list on the left hand side in JavaDoc.

Thanks
[ April 19, 2007: Message edited by: Gavin Tranter ]
 
Marshal
Posts: 67300
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Gavin Tranter:
Now I am NOT wishing to do this as a web2.0 (ick) app,



And yet you are describing (so-called) Web 2.0 functionality.

If you want to stick to old ways, you'll need to write your JSP to re-render the entire page with whatever changes you want to effect (such as "opening" a section). You could also employ iframes to changes only portions of the page by creating sub-pages.

If you want to stick really really old cob-webby ways, employ a frameset for the left side -- but that won't help you with the "opening" sections thingy.
[ April 20, 2007: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you're looking for a templating solution. Spring MVC typically uses Tiles for templating so you might want to check that out.
 
Gavin Tranter
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Bear Bibeault:


And yet you are describing (so-called) Web 2.0 functionality.



I wouldnt say its a description of Web2.0 functionality as such, this sort of interface metaphor has been about for a long time, it just means you do a round trip to refresh the page with the existing and additional data.

It has been done lots in web development over the years.

I have a JSP that shows a list and a JSP that displays details, So when clicking on an item in the list it displays the page with teh details. I am just wondering how to include the List JSP inside the details JSP. A stright froward include dosnt work.

I will check out tiles.

Thanks
G
 
Ranch Hand
Posts: 1211
Mac IntelliJ IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure how what you are asking is specific to Spring MVC.
Anyhow, if you are going to check out Tiles, also have a look at Sitemesh.

Sitemesh is literally a 5 minute setup, and, IMHO, a lot cleaner than Tiles.
 
Curse your sudden but inevitable betrayal! And this tiny ad too!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!