I stumbled a little so I made a note
I think it's super basic, but it wasn't in PHP
Class instantiation.
It's easy to find because it's featured everywhere.
//Instantiation of customer information
Customer customer = new Customer();
You can instantiate it by doing a new like this.
But how can I use what was instantiated on screen A without new on screen B?
I was at a loss, but when I tried it, it was quite easy.
SetAttribute on screen A (Java)
request.setAttribute("customer", customer);
Import and receive on screen B (JSP)
<%@ page import="pizzaOrderForm.customer.*" %>
Customer customer = (Customer)request.getAttribute("customer");
Now you can use the instantiated customer on another screen.
Java road is difficult ...
Recommended Posts