小编tet*_*tar的帖子

grails javax.servlet.ServletException:无法解析名称为“grailsDispatcherServlet”的servlet中名称为“/index”的视图

我正在尝试使用本教程运行我的应用程序:http : //guides.grails.org/building-a-react-app/guide/index.html

有 git 存储库 https://github.com/tetar998/building-a-react-app/tree/master/complete

但我遇到了这个错误无法解析名称为 'grailsDispatcherServlet' 的 servlet 中名称为 '/index' 的视图

我目前正在使用 - groovy 2.4.11 - java 8u152 - grails 3.3.0

有一张我的视图文件夹的图片 里面有我的控制器/演示/urlmappings

package demo

class UrlMappings {

static mappings = {
    "/$controller/$action?/$id?(.$format)?"{
        constraints {
            // apply constraints here
        }
    }

    "/"(view: '/index')
    "500"(view: '/error')
    "404"(view: '/notFound')
}
}
Run Code Online (Sandbox Code Playgroud)

有什么建议吗?

grails reactjs

5
推荐指数
0
解决办法
872
查看次数

无法在反应原生地图内移动按钮

我正在尝试在我的地图组件中移动一个按钮。我正在使用 react-native-maps

让我向你展示我的

render() {
console.log(this.state)
const { region } = this.state;
return (
  <View style={styles.container}>
    <MapView
      provider={this.props.provider}
      mapType="standard"
      style={styles.map}
      showsUserLocation={true}
      initialRegion={region}
    > 
      <UrlTile
        urlTemplate="XXX"
        zIndex={-1}
      />
      <Button style={{ borderWidth: 2, alignItems:'right',justifyContent:'right'}} title="Info" onPress={() => console.log("This is not fired")}/>
    </MapView>
    <View>
    </View>
  </View>
);
}
}


 const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  map: {
    marginTop: 20,
    flex: 1,
  },
});
Run Code Online (Sandbox Code Playgroud)

在这种情况下,我的按钮位于地图的中心/顶部,我想将其移动到地图的中心/右侧

任何的想法?谢谢

javascript react-native react-native-maps

1
推荐指数
1
解决办法
2450
查看次数

尝试上传到 Amazon S3 时出现“不受支持的正文有效负载对象”

我想将文件从我的前端上传到我的 Amazon S3 (AWS)。

我正在使用 dropzone,所以我转换了我的文件并将其发送到我的后端。

在我的后端我的文件是这样的:

{ fieldname: 'file',
originalname: 'test.torrent',
encoding: '7bit',
mimetype: 'application/octet-stream',
buffer: { type: 'Buffer', data: [Array] },
size: 7449 },
Run Code Online (Sandbox Code Playgroud)

当我尝试使用我的函数上传文件时:

var file = data.patientfile.file.buffer;

        var params = { Bucket: myBucket, Key: data.patientfile.file.fieldname, Body: file };

        s3.upload(params, function (err, data) {
            if (err) {
                console.log("******************",err)
            } else {
                console.log("Successfully uploaded data to myBucket/myKey");
            }
        });
Run Code Online (Sandbox Code Playgroud)

我得到错误:

不受支持的正文有效负载对象

你知道如何发送我的文件吗?

我试图将其发送putobject并收到类似的错误。

javascript amazon-s3 amazon-web-services node.js

1
推荐指数
1
解决办法
7320
查看次数