reset password
Author Message
disrael
Posts: 44
Posted 19:30 Jan 11, 2015 |

I was hoping to watch the recording on how to use Bootstrap for the servlet, but I don't think the videos are up yet. 

It seems to be working for the JSTL though. Any advice on how to get it to work for the servlet would be appreciated.  

Last edited by disrael at 19:30 Jan 11, 2015.
hippiewho
Posts: 46
Posted 20:30 Jan 11, 2015 |

What problem are you having with the servlet?

disrael
Posts: 44
Posted 21:39 Jan 11, 2015 |
hippiewho wrote:

What problem are you having with the servlet?

I can get it to work, to display "Hello Servlet." I'm not sure how to implement the html for it so it comes out formatted as in the Homework. In JSTL it was just copy, paste and change the information, but what do we do for the servlet?

Basically how to I attach the code in the picture to the servlet?

Attachments:
bruno1693
Posts: 48
Posted 21:43 Jan 11, 2015 |

you can do the print line for each line of the html, or you can create an html file with that, and then link it to the servlet

disrael
Posts: 44
Posted 21:49 Jan 11, 2015 |
bruno1693 wrote:

you can do the print line for each line of the html, or you can create an html file with that, and then link it to the servlet

I've tried creating an html file I guess I'm confused on how to link it to the servlet.

bruno1693
Posts: 48
Posted 22:01 Jan 11, 2015 |

search it on google. That's what I did lol. There are a few sites where they explained how. It's simple, but I don't have the links anymore lol

lakerfan94
Posts: 143
Posted 22:08 Jan 11, 2015 |

Did we necessarily have to use Bootstrap or was it just for adding more style to the servlet?

bruno1693
Posts: 48
Posted 22:10 Jan 11, 2015 |

yeah we have to make it exactly as the screenshots on the PDF

disrael
Posts: 44
Posted 22:14 Jan 11, 2015 |
bruno1693 wrote:

search it on google. That's what I did lol. There are a few sites where they explained how. It's simple, but I don't have the links anymore lol

What did you search under? I think it will work if I println all the html but there has to be a better way.

lakerfan94
Posts: 143
Posted 22:18 Jan 11, 2015 |

In the source code he gave us, Bootstrap is already implemented. Look at the line of code where it says "link rel". Right there, it has a link to the Bootstrap website and that's how we get the styling for the servlet and pretty much that's it.

lakerfan94
Posts: 143
Posted 22:19 Jan 11, 2015 |

Well I think. As long as our servlet and jsp display exactly like how it shows in the description, we're good right?

acervantes
Posts: 28
Posted 23:14 Jan 11, 2015 |

Bootstrap is simply a CSS document that is linked to by an HTML page.  If you are not seeing Twitter Bootstrap stylings in your page, a few things can be happening:

 

 

  1. You are not linking to a bootstrap.css file. (See the sample code in the PDF for an example of how to do this)
  2. You did not use the correct class names within within your HTML elements.

What is the URL to your working CS3 demo of the page that is not displaying Bootstrap correctly?

disrael
Posts: 44
Posted 12:14 Jan 12, 2015 |
acervantes wrote:

Bootstrap is simply a CSS document that is linked to by an HTML page.  If you are not seeing Twitter Bootstrap stylings in your page, a few things can be happening:

 

 

  1. You are not linking to a bootstrap.css file. (See the sample code in the PDF for an example of how to do this)
  2. You did not use the correct class names within within your HTML elements.

What is the URL to your working CS3 demo of the page that is not displaying Bootstrap correctly?

From the pdf I don't see how to link the bootstrap.css file. 

All I see in regards to this is

" Generate an HTML page 
 getWriter().println() 
 <html>, <head>, <body> ..."

Last edited by disrael at 12:15 Jan 12, 2015.
acervantes
Posts: 28
Posted 12:20 Jan 12, 2015 |

The URL to the CDN hosting the Bootstrap CSS file is in the source portion of the PDF.  

If you are unclear how to link to a CSS file from a HTML file, refer to your CS120 notes.