小编Har*_*ukh的帖子

如何解决Spring Boot Post请求中的403错误

我是Spring Boot Rest服务的新手。我已经使用maven项目在Spring Boot中开发了一些Rest API。

我已经成功开发了Get and Post Api。我的GET方法可以在邮递员和手机上正常工作。当我尝试从邮递员那里访问邮局方法时,它的工作正常,但从移动设备中给它403禁止错误

这是我的配置:

spring.datasource.url = jdbc:mysql://localhost/sampledb?useSSL=false
spring.datasource.username = te
spring.datasource.password = test
spring.jpa.properties.hibernate.dialect= org.hibernate.dialect.MySQL5InnoDBDialect
Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto = update
Run Code Online (Sandbox Code Playgroud)

请建议我如何解决错误。

在此处输入图片说明

rest spring maven spring-boot

20
推荐指数
5
解决办法
2万
查看次数

如何将数据从一个页面传递到另一个页面,以便在Ionic 2中进行导航

我是Ionic的初学者2.我想在点击列表项后将Json数据从一个页面传递到另一个页面.列表中的项目来自json,并且具有与每个项目相关联的特定ID.所以我想在特定项目上的点击事件之后传递特定的id.

这是json链接:

1. http://factoryunlock.in//products借助此链接,我将在列表中显示产品

在此输入图像描述

2.但现在我想表明,特定项目的细节.所以我用这个链接

http://factoryunlock.in/products/1
Run Code Online (Sandbox Code Playgroud)

我想products/1在特定项目的click事件后更改该ID(在链接2中).

这是我的Listview代码(Second.ts).

import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { EarthquakesProvider } from '../../providers/earthquakes/earthquakes';
import { DetailsPage } from '../details/details';
import { ChartsPage } from '../charts/charts';


@IonicPage()
@Component({
  selector: 'page-second',
  templateUrl: 'second.html',
  providers: [EarthquakesProvider]
})
export class SecondPage {

    public DateList: Array<Object>;

    constructor(public _navCtrl: NavController,
        public _earthquakes: EarthquakesProvider) {

       this.getEarthquakes();

    }
    public Listitem(l) {
        this._navCtrl.push(DetailsPage
            );

    }

    public openModal() {
        this._navCtrl.push(ChartsPage);

    } …
Run Code Online (Sandbox Code Playgroud)

hybrid-mobile-app ionic-framework multi-device-hybrid-apps ionic2 angular

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

如何将图像 url 转换为 Drawable Int

大家早上好 !!!!

我正在尝试在 Imageview 中显示图像。但我的要求是,我需要以可绘制整数格式显示图像。我从服务器获取数据并以 url 格式获取图像..

For ex :http://www.mymartmycart.com/images/detailed/3/4G_CONNECT_M1.jpeg
Run Code Online (Sandbox Code Playgroud)

我想将此图像转换为 Drawable 格式。

这是我的代码

这是我的界面

 public interface ECCardData<T> {

    @DrawableRes
    Integer getMainBackgroundResource();

    @DrawableRes
    Integer getHeadBackgroundResource();

    List<T> getListItems();
}
Run Code Online (Sandbox Code Playgroud)

我的吸气剂和吸气剂

     private Integer headBackgroundResource;

public Integer getHeadBackgroundResource() {
        return headBackgroundResource;
    }

    public void setHeadBackgroundResource(Integer headBackgroundResource) {
        this.headBackgroundResource = headBackgroundResource;
    }
Run Code Online (Sandbox Code Playgroud)

我在其中设置图像的代码

Integer drawableRes = dataset.get(position).getHeadBackgroundResource();
    if (drawableRes != null) {
        headView.setHeadImageBitmap(BitmapFactory.decodeResource(pagerContainer.getResources(), drawableRes, new BitmapFactoryOptions()));
    }
Run Code Online (Sandbox Code Playgroud)

这是我的解析

 public static ArrayList<CardData> ParseCraft(String response) throws JSONException {


        ArrayList<CardData> alUser = new ArrayList<>();

        JSONObject jsonRoot = …
Run Code Online (Sandbox Code Playgroud)

android json

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