@Override
public int doStartTag () throws JspException {
// Trace message
- this.LOG.trace("CALLED!");
+ this.LOG.trace("CALLED!"); //NOI18N
// Init output
- StringBuilder out = new StringBuilder("<div class=\"mini_basket\">\n");
+ StringBuilder out = new StringBuilder("<div class=\"mini_basket\">\n"); //NOI18N
// basket should not be null
if (this.getBasket() == null) {
// Not set
- throw new NullPointerException("basket instance is null");
+ throw new NullPointerException("basket instance is null"); //NOI18N
}
try {
// Some entries found?
if (this.getBasket().isEmpty()) {
// Empty basket
- out.append("<div class=\"mini_basket_box\">\n");
- out.append(this.getBasket().getMessageStringFromKey("MiniBasketTag.basket_is_empty")).append("\n");
- out.append("</div>\n");
+ out.append("<div class=\"mini_basket_box\">\n"); //NOI18N
+ out.append(this.getBasket().getMessageStringFromKey("MiniBasketTag.basket_is_empty")).append("\n"); //NOI18N
+ out.append("</div>\n"); //NOI18N
} else {
// Get all items
AddableBasketItem item = this.getBasket().getLast();
// item cannot be null here
if (null == item) {
// Abort here
- throw new NullPointerException("item is null");
+ throw new NullPointerException("item is null"); //NOI18N
}
// Get application bean from session
- PizzaBean bean = (PizzaBean) this.getBasket().getSession().getAttribute("controller");
+ PizzaBean bean = (PizzaBean) this.getBasket().getSession().getAttribute("controller"); //NOI18N
// Debug log
- this.LOG.debug("bean=" + bean);
+ this.LOG.debug(MessageFormat.format("bean={0}", bean)); //NOI18N
// Should not be null
if (null == bean) {
// Abort here
- throw new NullPointerException("bean is null");
+ throw new NullPointerException("bean is null"); //NOI18N
}
// Get product instance
Product product = bean.getProduct(item);
// Debug message
- this.LOG.debug("product=" + product);
+ this.LOG.debug(MessageFormat.format("product={0}", product)); //NOI18N
// Get last num rows
int lastNumRows = this.getBasket().getLastNumRows();
// Debug message
- this.LOG.debug("lastNumRows=" + lastNumRows);
+ this.LOG.debug(MessageFormat.format("lastNumRows={0}", lastNumRows)); //NOI18N
// Output all
- out.append("<div class=\"mini_basket_box\">\n");
- out.append(" <div class=\"mini_basket_last\">\n");
- out.append(" ").append(MessageFormat.format(this.getBasket().getMessageStringFromKey("MiniBasketTag.last_item"), product.getTitle()));
- out.append(" </div>\n");
- out.append(" <div class=\"mini_basket_more\">\n");
- out.append(" ").append(MessageFormat.format(this.getBasket().getMessageStringFromKey("MiniBasketTag.additional_items"), (lastNumRows - 1)));
- out.append(" </div>\n");
- out.append(" <div class=\"mini_basket_link\">\n");
- out.append(" <a href=\"").append(this.getBasket().getApplication().getContextPath()).append("/basket.jsp\">").append(this.getBasket().getMessageStringFromKey("MiniBasketTag.to_basket")).append("</a>\n");
- out.append(" </div>\n");
- out.append("</div>\n");
+ out.append("<div class=\"mini_basket_box\">\n"); //NOI18N
+ out.append(" <div class=\"mini_basket_last\">\n"); //NOI18N
+ out.append(" ").append(MessageFormat.format(this.getBasket().getMessageStringFromKey("MiniBasketTag.last_item"), product.getTitle())); //NOI18N
+ out.append(" </div>\n"); //NOI18N
+ out.append(" <div class=\"mini_basket_more\">\n"); //NOI18N
+ out.append(" ").append(MessageFormat.format(this.getBasket().getMessageStringFromKey("MiniBasketTag.additional_items"), (lastNumRows - 1))); //NOI18N
+ out.append(" </div>\n"); //NOI18N
+ out.append(" <div class=\"mini_basket_link\">\n"); //NOI18N
+ out.append(" <a href=\"").append(this.getBasket().getApplication().getContextPath()).append("/basket.jsp\">").append(this.getBasket().getMessageStringFromKey("MiniBasketTag.to_basket")).append("</a>\n"); //NOI18N
+ out.append(" </div>\n"); //NOI18N
+ out.append("</div>\n"); //NOI18N
}
} catch (final ServletException | IOException | SQLException | BadTokenException | CorruptedDatabaseFileException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
// Continue to throw
}
// Finish output
- out.append("</div>\n");
+ out.append("</div>\n"); //NOI18N
try {
// Get output instance and write it
}
// Trace message
- this.LOG.trace("Returning " + SKIP_BODY + " ... - EXIT!");
+ this.LOG.trace(MessageFormat.format("Returning {0} ... - EXIT!", SKIP_BODY)); //NOI18N
// Don't process any body
return SKIP_BODY;