Win a copy of Hands On Software Engineering with Python this week in the Jython/Python 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Multiple loop operation for JSP and Servlet  RSS feed

 
Greenhorn
Posts: 3
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm trying to make a program for room renting service, where I'm capturing the information of whole building as per the user input..

I'm restricted to use Servlet and JSP, I'm stuck in this program for long....

Here is my sample code to understand the logic..

Thanks in advance..


<h1>Enter The Details of Your property</h1>
<form action="property_register" method="post">
<table style="with: 50%">
<tr>
<td>Floor Number</td>
<td><input type="text" name="Floor_num" /></td>
int Floor_num = input.nextInt();
String Floor_numArray[] = new String[Floor_num];
input.nextLine();
for(int i = 0; i < Floor_numArray.length; i++)
{
<td>Total Room</td>
<td><input type="text" name="Total_room" /></td>
for(int i = 0; i < Floor_numArray.length; i++)
{
int Total_room = input.nextInt();
String Total_roomArray[] = new String[Total_room];
input.nextLine();
for(int j=0; j<Total_roomArray.length; j++)
{
<td>Rent Per Month</td>
<td><input type="text" name="Rent_perMonth" /></td>
int Rent_perMonth = input.nextInt();
String Rent_perMonthArray[] = new String[Rent_perMonth];
input.nextLine();

<td>Rent Per Day</td>
<td><input type="text" name="Rent_perDay" /></td>
int Rent_perDay = input.nextInt();
String Rent_perDayArray[] = new String[Rent_perDay];
input.nextLine();

<td>Enter the Deposit</td>
<td><input type="text" name="Deposit" /></td>
int Deposit = input.nextInt();
String depositArray[] = new String[Deposit];
input.nextLine();

<td>Available From</td>
<td><input type="text" name="Available_from" /></td>
int Available_from = input.nextInt();
String Available_from Array[] = new String[Availablr_from];
input.nextLine();
}
}
}
 
Ranch Hand
Posts: 210
2
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's your problem?
 
Al Hobbs
Ranch Hand
Posts: 210
2
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually....... you have java code slapped in an html page... No wonder it doesn't work.  
 
M Shekhar
Greenhorn
Posts: 3
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry I posted the wrong codes. I tried this code as a java application but now I want to implement it on JSP and Servlet but I don't know how to do it..

 
Al Hobbs
Ranch Hand
Posts: 210
2
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok so if want to make a web app you arent going to be getting input using the console.  I think make you should read up on basic jsp and servlet first.
 
Marshal
Posts: 67192
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read this article to understand what JSP is and how it operates.

Then read this article to understand how to properly structure Java web applications.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hard to read text plain
 
Al Hobbs
Ranch Hand
Posts: 210
2
Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should probably find resources in your native language.  Just search java and jsp on google.
 
passwords must contain 14 characters, a number, punctuation, a small bird, a bit of cheese and a tiny ad.
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!