Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.3 kB
1
Indexable
Never
<%@page import="bean.stockPrice"%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="bean.StockBean"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Stock Quote</title>
    </head>
    <body>
        <h1>Stock Quote Page</h1>
        <p>
            <%="Simbol koji ste uneli je: " + request.getParameter("simbol")%>
        </p>
        
        <jsp:useBean id="test" class="bean.StockBean" />
        <jsp:setProperty name="test" property="*" />

        <% stockPrice gener = new stockPrice();%>

        Simbol: <%=test.getSimbol()%><br>
        Cena pojedinacne akcije: <% 
            int cena = gener.getCena(test.getSimbol());
            out.println(cena + "<br>");
        %>
        Cena pune kolicine: <%            
            int kolicina = Integer.parseInt(request.getParameter("kolicina"));
            out.println(kolicina * cena + "<br><br>");
            if (cena == 0) {
                    out.println("UNELI STE NEPOSTOJECI SIMBOL! Bićete preusmereni na početnu stranu za 5 sekundi...");
                    response.setHeader("Refresh", "5;url=forma.jsp");
                }
        %>

    </body>
</html>