Skip to content

Instantly share code, notes, and snippets.

@trplll
Last active July 14, 2016 16:12
Show Gist options
  • Save trplll/274b8086e0c8a84aa3347abff1d653cf to your computer and use it in GitHub Desktop.
Save trplll/274b8086e0c8a84aa3347abff1d653cf to your computer and use it in GitHub Desktop.
Bootstrap Java List
@GET
@Path("/LoadShipments/{loadNum}")
@Produces(MediaType.TEXT_HTML)
public String getLoadLots(@PathParam("loadNum") String loadNum)
{
String Yep= new String();
Yep="<!DOCTYPE html> <html lang=\"en\"> <head> <title>Shipments for Load"+loadNum+"</title> <meta charset=\"utf-8\"> <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"> <link rel=\"stylesheet\" href=\"http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css\"> <script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js\"></script> <script src=\"http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js\"></script> </head> <body> <div class=\"container\"> <h2>Basic List Group</h2> <ul class=\"list-group\"> ";
logger.log(Level.getLevel("ACTIVITY"), "[getLoadLots] Getting lots on load " + loadNum);
Boolean explodeLoad = false;
ArrayList<String> tries = Load.getLoadFromDB(explodeLoad, loadNum).ShipList();
Iterator<String> shiperater = tries.iterator();
while (shiperater.hasNext()){
Yep+= ("<li class=\"list-group-item\">"+shiperater.next()+"</li>");
}
if (!Yep.isEmpty()) {
return Yep +"</ul> </div>";
} else {
return "Nope";
}
}
public ArrayList<String> ShipList() {
ArrayList<String> shiplist= new ArrayList<String>();
try {
QueryHelper f4941Helper = Entity.getDataTableHelper();
f4941Helper.rs = f4941Helper.stmt.executeQuery("Select * from F4941 where RSLDNM = " + LoadNumber);
if (f4941Helper.rs != null) {
while(f4941Helper.rs.next()) {
shiplist.add(f4941Helper.rs.getString("RSSHPN"));
}
return shiplist;
}
f4941Helper.destroy();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment