没有型号的Spring MVC控制器输出

时间:2017-03-03 13:09:43

标签: java spring jsp output

嗨,我有一个愚蠢的初学者问题 如何从Controller获取字符串到.jsp视图?

在控制器中我有类似的东西:

Option Explicit

Private pAssetFamilyCollection As Collection

'Get Set for the collection of AssetFamily
Public Property Get AssetFamilyCollection() As Collection
    Set AssetFamilyCollection = pAssetFamilyCollection
End Property

Public Property Set AssetFamilyCollection(lAssetFamilyCollection As Collection)
    Set pAssetFamilyCollection = lAssetFamilyCollection
End Property

Public Sub DefaultValue()

    Dim fmly As AssetFamily
    For Each fmly In AssetFamilyCollection
            fmly.checked = False
            fmly.startColumn = 0
    Next fmly

End Sub

Public Sub CountAssetByFamily(CollectionOfAsset As Collection)

    Dim asst As Asset
    Dim fmly As AssetFamily
    Dim sum As Integer

    fmly.numberOfAsset = 0

    For Each fmly In Me

        fmly.numberOfAsset

        For Each asst In CollectionOfAsset
            If asst.familyName = fmly.name Then
                fmly.numberOfAsset = fmly.numberOfAsset + 1
            End If
        Next asst

    Next fmly


End Sub

我的.jsp看起来像

 @RequestMapping(value = "/users/add", method = RequestMethod.GET)
 public String showAddUserForm(Model model) {
 model.addAttribute("times1List", times1);
...
 String myText = "data from external whatever...";
 model.addAttribute("Group",myText);
...
return "users/userform";

我看不到字符串,只有"#"是可见的,无法看到问题所在

我需要" ModelAndView"? 输出一个变量

是不是很复杂

0 个答案:

没有答案
相关问题