From 7174444c41811135fee26f36043f5067c4a82436 Mon Sep 17 00:00:00 2001 From: AdeelIlyas2014 Date: Fri, 10 Jul 2015 15:26:40 +0500 Subject: [PATCH] Aspose.Barcode Java for Struts 1.3 - v1.0 Signed-off-by: AdeelIlyas2014 --- Plugins/Aspose_Barcode_for_Struts/.classpath | 31 ++++++ Plugins/Aspose_Barcode_for_Struts/.project | 29 ++++++ Plugins/Aspose_Barcode_for_Struts/README.md | 14 +++ .../src/main/java/com/books/BookActions.java | 85 +++++++++++++++ .../src/main/java/com/books/BookForm.java | 47 +++++++++ .../src/main/java/com/books/Books.java | 97 ++++++++++++++++++ .../src/main/java/com/books/ShowBooks.java | 19 ++++ .../main/java/com/books/aspose/AsposeAPI.java | 39 +++++++ .../books/aspose/AsposeAPIConfiguration.java | 17 +++ .../aspose/AsposeAPIgetBarcodeUrlTag.java | 79 ++++++++++++++ .../com/books/aspose/AsposeBarcodeAction.java | 48 +++++++++ .../com/books/aspose/FieldPathParser.java | 37 +++++++ .../java/com/books/aspose/ScopedContext.java | 48 +++++++++ .../src/main/webapp/WEB-INF/struts-config.xml | 31 ++++++ .../src/main/webapp/WEB-INF/web.xml | 34 ++++++ .../main/webapp/images/aspose-struts-logo.jpg | Bin 0 -> 7765 bytes .../src/main/webapp/jsp/books/addbook.jsp | 36 +++++++ .../src/main/webapp/jsp/books/books.jsp | 87 ++++++++++++++++ .../src/main/webapp/jsp/books/editbook.jsp | 40 ++++++++ .../src/main/webapp/jsp/books/index.jsp | 1 + .../src/main/webapp/tags/AsposeAPI.tld | 37 +++++++ 21 files changed, 856 insertions(+) create mode 100644 Plugins/Aspose_Barcode_for_Struts/.classpath create mode 100644 Plugins/Aspose_Barcode_for_Struts/.project create mode 100644 Plugins/Aspose_Barcode_for_Struts/README.md create mode 100644 Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/BookActions.java create mode 100644 Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/BookForm.java create mode 100644 Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/Books.java create mode 100644 Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/ShowBooks.java create mode 100644 Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/AsposeAPI.java create mode 100644 Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/AsposeAPIConfiguration.java create mode 100644 Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/AsposeAPIgetBarcodeUrlTag.java create mode 100644 Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/AsposeBarcodeAction.java create mode 100644 Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/FieldPathParser.java create mode 100644 Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/ScopedContext.java create mode 100644 Plugins/Aspose_Barcode_for_Struts/src/main/webapp/WEB-INF/struts-config.xml create mode 100644 Plugins/Aspose_Barcode_for_Struts/src/main/webapp/WEB-INF/web.xml create mode 100644 Plugins/Aspose_Barcode_for_Struts/src/main/webapp/images/aspose-struts-logo.jpg create mode 100644 Plugins/Aspose_Barcode_for_Struts/src/main/webapp/jsp/books/addbook.jsp create mode 100644 Plugins/Aspose_Barcode_for_Struts/src/main/webapp/jsp/books/books.jsp create mode 100644 Plugins/Aspose_Barcode_for_Struts/src/main/webapp/jsp/books/editbook.jsp create mode 100644 Plugins/Aspose_Barcode_for_Struts/src/main/webapp/jsp/books/index.jsp create mode 100644 Plugins/Aspose_Barcode_for_Struts/src/main/webapp/tags/AsposeAPI.tld diff --git a/Plugins/Aspose_Barcode_for_Struts/.classpath b/Plugins/Aspose_Barcode_for_Struts/.classpath new file mode 100644 index 0000000..9ae7bca --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/.classpath @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Plugins/Aspose_Barcode_for_Struts/.project b/Plugins/Aspose_Barcode_for_Struts/.project new file mode 100644 index 0000000..d8dbe78 --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/.project @@ -0,0 +1,29 @@ + + + Aspose_Barcode_for_Struts + + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + + diff --git a/Plugins/Aspose_Barcode_for_Struts/README.md b/Plugins/Aspose_Barcode_for_Struts/README.md new file mode 100644 index 0000000..3cb1a55 --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/README.md @@ -0,0 +1,14 @@ +# Aspose.Barcode Java for Struts 1.3 + +Aspose Barcode Java for Struts is a Maven based struts 1.3 web project that demonstrates the usage of Aspose.Barcode for Java API (for generating barcode images) within Apache Struts 1.3 Web MVC and Maven frameworks. + +The project can be built through mvn command line without any IDE support. + +However the project can also be easily imported in any IDE i.e IntelliJ IDEA and NetBeans etc. + +You should have Apache Tomcat pre-installed. After building the project .war file, just copy it to webapp folder. + +For complete documentation of the project, check Aspose.Barcode Java for Struts confluence wiki + +http://www.aspose.com/docs/display/barcodejava/1.+Aspose.Barcode+Java+For+Struts + diff --git a/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/BookActions.java b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/BookActions.java new file mode 100644 index 0000000..4c1b7a5 --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/BookActions.java @@ -0,0 +1,85 @@ +package com.books; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionForward; +import org.apache.struts.actions.DispatchAction; + +import com.books.aspose.AsposeAPI; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * + * @author Adeel + * + */ + +public class BookActions extends DispatchAction { + public ActionForward AddBook(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) { + System.out.println("Add Book Page"); + return mapping.findForward("addBook"); + } + + public ActionForward EditBook(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) { + System.out.println("Edit Book Page"); + int bookId = Integer.parseInt(request.getParameter("bookId")); + + Books b = Books.getInstance(); + Map bookDet = b.searchBook(bookId); + + // Used form bean class methods to fill the form input elements with + // selected book values. + BookForm bf = (BookForm) form; + bf.setBookName(bookDet.get("BookName").toString()); + bf.setAuthorName(bookDet.get("AuthorName").toString()); + bf.setBookCost((Integer) bookDet.get("BookCost")); + bf.setBookId((Integer) bookDet.get("BookId")); + return mapping.findForward("editBook"); + } + + public ActionForward SaveBook(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) { + System.out.println("Save Book"); + // Used form bean class methods to get the value of form input elements. + BookForm bf = (BookForm) form; + String bookName = bf.getBookName(); + String authorName = bf.getAuthorName(); + int bookCost = bf.getBookCost(); + + Books b = Books.getInstance(); + b.storeBook(bookName, authorName, bookCost); + return new ActionForward("/showbooks.do", true); + } + + public ActionForward UpdateBook(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) { + System.out.println("Update Book"); + BookForm bf = (BookForm) form; + String bookName = bf.getBookName(); + String authorName = bf.getAuthorName(); + int bookCost = bf.getBookCost(); + int bookId = bf.getBookId(); + + Books b = Books.getInstance(); + b.updateBook(bookId, bookName, authorName, bookCost); + return new ActionForward("/showbooks.do", true); + } + + public ActionForward DeleteBook(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) { + System.out.println("Delete Book"); + int bookId = Integer.parseInt(request.getParameter("bookId")); + Books b = Books.getInstance(); + b.deleteBook(bookId); + return new ActionForward("/showbooks.do", true); + } +} \ No newline at end of file diff --git a/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/BookForm.java b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/BookForm.java new file mode 100644 index 0000000..d7f8341 --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/BookForm.java @@ -0,0 +1,47 @@ +package com.books; + +import org.apache.struts.action.ActionForm; + +public class BookForm extends ActionForm { + + private String bookName; + private String authorName; + private int bookCost; + private int bookId; + + public BookForm() { + super(); + } + + public String getBookName() { + return bookName; + } + + public void setBookName(String bookName) { + this.bookName = bookName; + } + + public String getAuthorName() { + return authorName; + } + + public void setAuthorName(String authorName) { + this.authorName = authorName; + } + + public int getBookCost() { + return bookCost; + } + + public void setBookCost(int bookCost) { + this.bookCost = bookCost; + } + + public int getBookId() { + return bookId; + } + + public void setBookId(int bookId) { + this.bookId = bookId; + } +} \ No newline at end of file diff --git a/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/Books.java b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/Books.java new file mode 100644 index 0000000..d0381f2 --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/Books.java @@ -0,0 +1,97 @@ +package com.books; + +import java.util.Map; +import java.util.HashMap; +import java.util.List; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.Set; + +class Books { + + int bookIdCount = 1000; + Map bookMap = new HashMap(); + private static Books books = null; + + private Books() { + } + + public static Books getInstance() { + if (books == null) { + books = new Books(); + books.storeBook("Mastering Java", "John Zakowsi", 200); + books.storeBook( + "Struts in Action", + "Cedric Dumoulin, David Winterfeldt, George Franciscus, and Ted Husted", + 500); + + } + return books; + } + + public void storeBook(String bookName, String authorName, int bookCost) { + StoreBook sb = new StoreBook(); + bookIdCount++; + sb.addBook(bookIdCount, bookName, authorName, bookCost); + bookMap.put(bookIdCount, sb); + } + + public void updateBook(int bookId, String bookName, String authorName, + int bookCost) { + StoreBook sb = bookMap.get(bookId); + sb.updateBook(bookName, authorName, bookCost); + } + + public Map searchBook(int bookId) { + return bookMap.get(bookId).getBooks(); + } + + public void deleteBook(int bookId) { + bookMap.remove(bookId); + } + + // Inner Class used to persist the app data ie) book details. + class StoreBook { + + private String bookName; + private String authorName; + private int bookCost; + private int bookId; + + StoreBook() { + } + + public void addBook(int bookId, String bookName, String authorName, + int bookCost) { + this.bookId = bookId; + this.bookName = bookName; + this.authorName = authorName; + this.bookCost = bookCost; + } + + public void updateBook(String bookName, String authorName, int bookCost) { + this.bookName = bookName; + this.authorName = authorName; + this.bookCost = bookCost; + } + + public Map getBooks() { + Map books = new HashMap(); + books.put("BookId", this.bookId); + books.put("BookName", this.bookName); + books.put("AuthorName", this.authorName); + books.put("BookCost", this.bookCost); + return books; + } + } + + public List getBookList() { + List booksList = new ArrayList(); + Set s = bookMap.keySet(); + Iterator itr = s.iterator(); + while (itr.hasNext()) { + booksList.add(bookMap.get((Integer) itr.next()).getBooks()); + } + return booksList; + } +} \ No newline at end of file diff --git a/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/ShowBooks.java b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/ShowBooks.java new file mode 100644 index 0000000..0f52ddc --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/ShowBooks.java @@ -0,0 +1,19 @@ +package com.books; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.Action; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +public class ShowBooks extends Action { + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) { + System.out.println("Show Books List"); + Books b = Books.getInstance(); + request.setAttribute("booksList", b.getBookList()); + return mapping.findForward("success"); + } +} \ No newline at end of file diff --git a/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/AsposeAPI.java b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/AsposeAPI.java new file mode 100644 index 0000000..f378b2d --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/AsposeAPI.java @@ -0,0 +1,39 @@ +package com.books.aspose; + +import javax.servlet.ServletOutputStream; + +import com.aspose.barcode.BarCodeBuilder; +import com.aspose.barcode.BarCodeImageFormat; +import com.aspose.barcode.CodeLocation; + +/* + * @author: Adeel Ilyas + * Company: Aspose Pty Ltd. + * + */ +public class AsposeAPI { + public static void createAsposeBarCode(String billAmount, + ServletOutputStream out, String symbology) { + + BarCodeBuilder bb = new BarCodeBuilder(); + + // Set up code text (data to be encoded) + bb.setCodeText(billAmount); + + // Set up code text color + bb.setCodeTextColor(java.awt.Color.RED); + + // Set the location of the code text to above the barcode + bb.setCodeLocation(CodeLocation.Above); + + // Increase the space between code text and barcode to 1 point + bb.setCodeTextSpace(1.0f); + + // Set the symbology type + bb.setSymbologyType(Long.valueOf(symbology)); + + bb.save(out, BarCodeImageFormat.Png); + + } + +} diff --git a/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/AsposeAPIConfiguration.java b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/AsposeAPIConfiguration.java new file mode 100644 index 0000000..cdbd66f --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/AsposeAPIConfiguration.java @@ -0,0 +1,17 @@ +package com.books.aspose; + +/** + * Created by Adeel Ilyas on 7/6/2015. + */ +/* + * @author: Adeel Ilyas + * Company: Aspose Pty Ltd. + */ + +public interface AsposeAPIConfiguration { + + public static final String BarcodeServiceURL = "/asposeBarcode.do"; + + public static final String BarcodeTypeConstantClass="com.aspose.barcode.Symbology"; +} + diff --git a/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/AsposeAPIgetBarcodeUrlTag.java b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/AsposeAPIgetBarcodeUrlTag.java new file mode 100644 index 0000000..ca37005 --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/AsposeAPIgetBarcodeUrlTag.java @@ -0,0 +1,79 @@ +package com.books.aspose; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +import javax.servlet.ServletRequest; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.PageContext; +import javax.servlet.jsp.tagext.SimpleTagSupport; + +/** + * Created by Adeel Ilyas on 7/6/2015. + */ +/* + * @author: Adeel Ilyas Company: Aspose Pty Ltd. + */ +public class AsposeAPIgetBarcodeUrlTag extends SimpleTagSupport implements + AsposeAPIConfiguration { + + private String symbology; + private String billamount; + private String varName; + private String scopeName; + + public void setSymbology(String symbology) { + this.symbology = symbology; + } + + public void setBillAmount(String billamount) { + this.billamount = billamount; + } + + public void setVar(String value) { + this.varName = value; + } + + public void setScope(String value) { + this.scopeName = value; + } + + public void doTag() throws JspException { + try { + ScopedContext scopedContext = (this.scopeName == null) ? ScopedContext.PAGE + : ScopedContext.getInstance(this.scopeName); + Object constantValue = getSymbologyValue(BarcodeTypeConstantClass + + "." + this.symbology); + constantValue = BarcodeServiceURL +"?billAmount="+ billamount + "&symbology="+constantValue; + PageContext pageContext = (PageContext)getJspContext(); + + String webContext=pageContext.getServletContext().getContextPath(); + ServletRequest servletRequest = pageContext.getRequest(); + String serviceUrl = servletRequest.getScheme()+"://"+servletRequest.getServerName()+":"+servletRequest.getServerPort()+webContext; + + getJspContext().setAttribute(this.varName, serviceUrl+constantValue, + scopedContext.getValue()); + } catch (Exception e) { + throw new JspException("Exception setting constant " + + this.symbology, e); + } + } + + public Object getSymbologyValue(String Symbology) + throws IllegalAccessException, InstantiationException, + ClassNotFoundException, NoSuchFieldException { + Field field; + FieldPathParser parser = new FieldPathParser(Symbology); + field = Class.forName(parser.getDeclaringClassName()).getField( + parser.getFieldName()); + if ((!Modifier.isPublic(field.getModifiers())) + || (!Modifier.isStatic(field.getModifiers())) + || (!Modifier.isFinal(field.getModifiers()))) { + throw new IllegalArgumentException(Symbology + + " is not a public static final member"); + } + + return field.get(null); + } + +} \ No newline at end of file diff --git a/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/AsposeBarcodeAction.java b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/AsposeBarcodeAction.java new file mode 100644 index 0000000..86ba0e6 --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/AsposeBarcodeAction.java @@ -0,0 +1,48 @@ +package com.books.aspose; + +import java.io.IOException; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.Action; + +import com.books.aspose.AsposeAPI; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +/** + * Created by Adeel Ilyas on 7/8/2015. + */ +/* + * @author: Adeel Ilyas Company: Aspose Pty Ltd. + */ +public class AsposeBarcodeAction extends Action { + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) { + System.out.println("Aspose Barcode Image"); + try { + ServletOutputStream out = response.getOutputStream(); + response.setContentType("image/png"); + + + String symbology = request.getParameter("symbology"); + String codeText = request.getParameter("billAmount"); + + AsposeAPI.createAsposeBarCode(codeText, out,symbology); + out.flush(); + out.close(); + + + System.out.println("BillAmount: " + codeText); + + + } catch (IOException io) { + io.printStackTrace(); + + } + + return null; + } +} \ No newline at end of file diff --git a/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/FieldPathParser.java b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/FieldPathParser.java new file mode 100644 index 0000000..12f8f93 --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/FieldPathParser.java @@ -0,0 +1,37 @@ +package com.books.aspose; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; +/* + * + * @author: Adeel Ilyas + * Company: Aspose Pty Ltd. + */ + +public class FieldPathParser +{ +private static final String REGEX_FIELD_PATH = "((\\w+\\.)+)(\\w+)"; +private static final int GROUP_INDEX_CLASS = 1; +private static final int GROUP_INDEX_FIELD = 3; +private String className; +private String fieldName; + +public FieldPathParser(String path) +{ +Matcher matcher = Pattern.compile("((\\w+\\.)+)(\\w+)").matcher(path); +matcher.find(); +this.className = matcher.group(1); +this.className = this.className.substring(0, this.className.length() - 1); +this.fieldName = matcher.group(3); +} + +public String getDeclaringClassName() +{ +return this.className; +} + +public String getFieldName() +{ +return this.fieldName; +} +} \ No newline at end of file diff --git a/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/ScopedContext.java b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/ScopedContext.java new file mode 100644 index 0000000..c053052 --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/src/main/java/com/books/aspose/ScopedContext.java @@ -0,0 +1,48 @@ +package com.books.aspose; + +import java.util.HashMap; +import java.util.Map; + +/* + * @author: Adeel Ilyas + * Company: Aspose Pty Ltd. + */ + +public class ScopedContext { + public static final String SCOPE_NAME_PAGE = "page"; + public static final String SCOPE_NAME_REQUEST = "request"; + public static final String SCOPE_NAME_SESSION = "session"; + public static final String SCOPE_NAME_APPLICATION = "application"; + private static final Map BY_NAME = new HashMap(); + private static final Map BY_VALUE = new HashMap(); + public static final ScopedContext PAGE = new ScopedContext("page", 1); + public static final ScopedContext REQUEST = new ScopedContext("request", 2); + public static final ScopedContext SESSION = new ScopedContext("session", 3); + public static final ScopedContext APPLICATION = new ScopedContext( + "application", 4); + private String name; + private int value; + + private ScopedContext(String name, int value) { + this.name = name; + this.value = value; + BY_NAME.put(this.name, this); + BY_VALUE.put(new Integer(this.value), this); + } + + public String getName() { + return this.name; + } + + public int getValue() { + return this.value; + } + + public static ScopedContext getInstance(String name) { + return (ScopedContext) BY_NAME.get(name); + } + + public static ScopedContext getInstance(int value) { + return (ScopedContext) BY_VALUE.get(new Integer(value)); + } +} diff --git a/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/WEB-INF/struts-config.xml b/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/WEB-INF/struts-config.xml new file mode 100644 index 0000000..fe5b7a7 --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/WEB-INF/struts-config.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/WEB-INF/web.xml b/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..60f9fb2 --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,34 @@ + + + StrutsbookApp + + + action + org.apache.struts.action.ActionServlet + + config + /WEB-INF/struts-config.xml + + + validate + true + + 1 + + + + action + *.do + + + + + /jsp/books/index.jsp + + + + + \ No newline at end of file diff --git a/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/images/aspose-struts-logo.jpg b/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/images/aspose-struts-logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e5c2ffde300a3fbb7d8640e613ef0543e8e72f09 GIT binary patch literal 7765 zcmbVwc{tQx{O?EhEy*4=C6R1pCrm1Ym@ksuB-s*@WN4UD)@Wo6X_76W$vU=7j3xDz z?6S@v`!Zu0AIx&6-~Bzm`#isU|G4+Q&pFR?p0mAQujici`@GL#jxveB5erjuQ-F<) z4Y-%I0pa#53BDez|N|%vC@ACa~!w=9AabpoBvbTIobaT7Y7GB zCpQ;2_us<9%g@Wh!^gwT%_qpm$1lJVZr;N}f&z#C*8eW@clzI1tSrF8&GUD}|C=zs z0>V6iDNx4FCJP)AW@8s-W3~ej7FJFcqras7Q`io%b8vF8Ao20D2Gky5!DnYb!~)C7 z!ND3G$?69C2U^Vzzx`IgQ&7qIvnmB_ySeosm~K zt9VXROIt@*PyfnQ6H~Km<`#B0>~A_aIyrmZ@$&ZZ^}8GLF!WIvB0S>R^O)GU_=LpN zwDgS3tk>B&?+Xfxic3C}eypmlsjb7+H#D{p+B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Zfo3`?e4K|&@;_bHK8z-^-y`xNk3b0-@0Y#cQ z$IEj{5>yL>r~Gjw=XIN>>1cLg(`!H5S2}0fy%Uu->ciNLZSD6W*O|a@*QQSr(mtp8 zVHNh?5Wic8lfrVp6_(}44BIMc{zNy08TkbH>`#8w#$t@l{*TAcC#C5oq7Fl5A>?8k zGPDgMNYm~chmjdCiWjM>4{p`s9QztWfskJ}t)Cv~gA#4}cZQFlVjjA<=mm=ZA-UKq z&JzJ5q>*rU^E~2xqG4fE_JJ-{8yP^x6PUn}wY9aK9tdpcG!CUM9L$4KjJsU&fp+c- zwsk{baZHSw$MvF^P_k^&Gub$ + + +

+

+ Aspose.Barcode for Java Aspose.Barcode Struts Example - + Simple Book Store App +

+ Add Book + + + + + + + + + + + + + + +
Book Name
Author Name
Book Cost
+

+

+ + + + +
+ +

+ + \ No newline at end of file diff --git a/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/jsp/books/books.jsp b/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/jsp/books/books.jsp new file mode 100644 index 0000000..7adc823 --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/jsp/books/books.jsp @@ -0,0 +1,87 @@ +<%@ page import="java.util.HashMap"%> +<%@ page import="java.util.Map"%> +<%@ page import="java.util.List"%> +<%@ page import="java.util.ArrayList"%> +<%@ page import="java.util.Iterator"%> +<%@ taglib uri="/tags/AsposeAPI.tld" prefix="aspose"%> + + + + + +

+

+ Aspose.Barcode for Java + Aspose.Barcode Struts Example - Simple Book Store App +

+ Available Books +
+ + + + + + + + + <% + List bookList = (ArrayList) request.getAttribute("booksList"); + Iterator itr = bookList.iterator(); + while (itr.hasNext()) { + Map map = (HashMap) itr.next(); + %> + + + + + + + + <% + } + %> +
 Book NameAuthor NameBook CostBarCode
<%=map.get("BookName")%><%=map.get("AuthorName")%><%=map.get("BookCost")%>Sponsored by Aspose
+

+

+ + + + + + + +
+
+

+

+ + + \ No newline at end of file diff --git a/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/jsp/books/editbook.jsp b/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/jsp/books/editbook.jsp new file mode 100644 index 0000000..14560ef --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/jsp/books/editbook.jsp @@ -0,0 +1,40 @@ +<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%> + + +

+

+ Aspose.Barcode for Java Aspose.Barcode Struts Example - + Simple Book Store App +

+ Edit Book + + + + + + + + + + + + + + + + + + +
Book Id
Book Name
Author Name
Book Cost
+

+

+ + + + +
+ +

+ + \ No newline at end of file diff --git a/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/jsp/books/index.jsp b/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/jsp/books/index.jsp new file mode 100644 index 0000000..f1272db --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/jsp/books/index.jsp @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/tags/AsposeAPI.tld b/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/tags/AsposeAPI.tld new file mode 100644 index 0000000..424d5d6 --- /dev/null +++ b/Plugins/Aspose_Barcode_for_Struts/src/main/webapp/tags/AsposeAPI.tld @@ -0,0 +1,37 @@ + + + + + 1.0 + 1.2 + Constant Tags + + + getBarcodeUrl + com.books.aspose.AsposeAPIgetBarcodeUrlTag + empty + + symbology + true + true + + + billAmount + true + true + + + var + true + false + + + scope + false + false + + + + \ No newline at end of file