• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to link a JSP file contains CSS template to other JSP properly

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm currently trying to link a JSP file that i have made which contains CSS style for Header bar. The Header bar is a template for every JSP file in the future made. Unfortunately it did not show the result i expected. The HTML showing irregular results. I will breakdown every step as clear as possible.

In image 1, you can see that I set "example" word as an example for further image.

As you can see, in image 2, the word i used in header.jsp is showing on the place i wanted to be. You can judge by the scroll on the right is right at the top.

Then, i created new JSP file for another page that include header.jsp for the Header bar. Below are the codes:



and resulting as in image 3. You can judge the scroll on the right is right at the very bottom.

I want the data in image 3 to be right at the top such as the result in image 2

How can I fix the syntax above to show it properly?

Thank you

Note: i apologize if images did not show efficiently due to lack of understanding. Therefore i attached the images instead.
image-1.PNG
[Thumbnail for image-1.PNG]
image-2.PNG
[Thumbnail for image-2.PNG]
image-3.PNG
[Thumbnail for image-3.PNG]
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This sure looks like a question about HTML and CSS to me, so I've moved it to the "HTML and CSS and JavaScript" forum. I don't see how JSP is relevant to the question, and anyway your design process should involve creating correctly-working HTML (and CSS) followed by creating a JSP which outputs that HTML and CSS.

Have you already established that the HTML and CSS works correctly, except when you include it from JSP it doesn't work correctly?
 
Marshal
Posts: 4491
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Formatted copy of your markup:
 
Ron McLeod
Marshal
Posts: 4491
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not clear (to me) what problem you are trying to solve.  It is with the nav bar in your header.jsp file, or the page-specific code?

When I render your markup on my browser, I see this:


Are you expecting it to show as something like this?:
 
Emir Rayhan
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:T
Have you already established that the HTML and CSS works correctly, except when you include it from JSP it doesn't work correctly?



Yes the HTML and CSS works properly. Although, it did not show the end result i esxpected when i run the file.
 
Emir Rayhan
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ron McLeod wrote:

When I render your markup on my browser, I see this:


Are you expecting it to show as something like this?:



I'm sorry, I cannot see the image you sent.
 
Paul Clapham
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Emir Rayhan wrote:Yes the HTML and CSS works properly. Although, it did not show the end result i esxpected when i run the file.



And did you look at the page source in the browser to see if the JSP had been included as you expected? Or use the browser's tools which allow you to inspect elements and the CSS used to render them?
 
Emir Rayhan
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:

Emir Rayhan wrote:Yes the HTML and CSS works properly. Although, it did not show the end result i esxpected when i run the file.



And did you look at the page source in the browser to see if the JSP had been included as you expected? Or use the browser's tools which allow you to inspect elements and the CSS used to render them?



Both Header bar page as a layout and the other page in image 3 are included. Yet, i cannot control the data there to be where i exepected.
 
Emir Rayhan
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for the responses! I have taken a look deeper on my source and apparently  found that there are variables in my header.jsp that blocking the variables of other pages.
 
Paul Clapham
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good! You're making progress!
reply
    Bookmark Topic Watch Topic
  • New Topic