title: "No default constructor found" using Spring MVC with Yahoo Finance API
body: <p>This will be probably a stupid question but I can't figured out a possible solution by myself. 
  Basically I'm trying to create a simple Java web application using Spring MVC and Yahoo Finance API.
  My goal was to create a simple form where I will be able to insert the symbol of a specific stock (example: INTC (intel corporation)) and get its "dividend", "price", "quote", etc.</p>
  
  <p>My addStock.jsp:</p>
  
  <pre><code>&lt;form:form method="POST" modelAttribute="stock"&gt;
      &lt;label&gt;Symbol:&lt;/label&gt;
      &lt;form:input path="symbol" /&gt;
      &lt;input type="submit" /&gt;
  &lt;/form:form&gt;
  </code></pre>
  
  <p>Part of AddStock.java:</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.GET, params="new")
  public String createForm(Model model) {
      Stock stock = new Stock();
      model.addAttribute("stock", stock);
      return "addStock";
  }
  
  @RequestMapping(method = RequestMethod.POST)
  public String add(Stock stock, BindingResult result, Model model) throws IOException {
      String name = "";
      BigDecimal price = new BigDecimal("0.00");
      BigDecimal change = new BigDecimal("0.00");
      BigDecimal peg = new BigDecimal("0.00");
      BigDecimal dividend = new BigDecimal("0.00");
      BigDecimal bookValuePerShare = new BigDecimal("0.00");
      if(!result.hasErrors()){
          yahooFinService.addStock(stock);
          if (YahooFinance.get(stock.getSymbol()).getQuote().getPrice() != null) {
              symbol = stock.getSymbol();
              name = YahooFinance.get(stock.getSymbol()).getName();
              price = YahooFinance.get(stock.getSymbol()).getQuote().getPrice();
              change = YahooFinance.get(stock.getSymbol()).getQuote().getChangeInPercent();
              peg = YahooFinance.get(stock.getSymbol()).getStats().getPeg();
              dividend = YahooFinance.get(stock.getSymbol()).getDividend().getAnnualYieldPercent();
              bookValuePerShare = YahooFinance.get(stock.getSymbol()).getStats().getBookValuePerShare();
          }
          model.addAttribute("symbol", symbol);
          model.addAttribute("name", name);
          model.addAttribute("price", price);
          model.addAttribute("change", change);
          model.addAttribute("peg", peg);
          model.addAttribute("dividend", dividend);
          model.addAttribute("bookValuePerShare", bookValuePerShare);
  
          YahooFinance.get(stock.getSymbol()).print();
      }
      return "result";
  }
  </code></pre>
  
  <p>My "problem" come when I create the empty constructor "Stock".
  The Yahoo Finance doesn't provide an empty constructor but just:</p>
  
  <pre><code>public Stock(String symbol) {
      this.symbol = symbol;
  }
  </code></pre>
  
  <p>What should I do?? Of course everything is working properly when I create a new bean, copying whole code from the API, adding the empty constructor and importing (code that I have provided) but I don't think it is the correct way to use an API and even if it is "legal".
  I thought about to create a new java class which will extend the classes from Yahoo Finance API but it doesn't permit to add an empty constructor either.</p>
  
  <p>I'm aware my problem is more about "java knowledge" but if someone could help me would be great. I hope I have explained properly my problem. Cheers</p>